diff options
author | Andy Schwerin <schwerin@10gen.com> | 2012-04-30 15:00:46 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@10gen.com> | 2012-04-30 15:10:02 -0400 |
commit | a3551eadc4857ac4daf07837157909dc2d474c08 (patch) | |
tree | cf5e49db819650e770430cb0be415cf0e76c131f | |
parent | f31d4d9acaee1e11f2ff0f1e84929ffb684ae053 (diff) | |
download | mongo-a3551eadc4857ac4daf07837157909dc2d474c08.tar.gz |
Stop using mongo::dbexit() in malloc/realloc out-of-memory situations.
This is only marginally better, but is a stop gap pending a fuller startup/shutdown
rewrite.
See SERVER-5520 to track the shutdown rewrite.
-rw-r--r-- | src/mongo/util/allocator.h | 6 | ||||
-rw-r--r-- | src/mongo/util/signal_handlers.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/util/allocator.h b/src/mongo/util/allocator.h index fae1364546f..a8ec3b39fec 100644 --- a/src/mongo/util/allocator.h +++ b/src/mongo/util/allocator.h @@ -17,6 +17,8 @@ #pragma once +#include "mongo/util/signal_handlers.h" + // we need the "real" malloc here #include "mongo/client/undef_macros.h" @@ -24,13 +26,13 @@ namespace mongo { inline void * ourmalloc(size_t size) { void *x = malloc(size); - if ( x == 0 ) dbexit( EXIT_OOM_MALLOC , "malloc fails"); + if ( x == 0 ) printStackAndExit(0); return x; } inline void * ourrealloc(void *ptr, size_t size) { void *x = realloc(ptr, size); - if ( x == 0 ) dbexit( EXIT_OOM_REALLOC , "realloc fails"); + if ( x == 0 ) printStackAndExit(0); return x; } diff --git a/src/mongo/util/signal_handlers.h b/src/mongo/util/signal_handlers.h index 9d3a735a723..b15533c74b5 100644 --- a/src/mongo/util/signal_handlers.h +++ b/src/mongo/util/signal_handlers.h @@ -18,8 +18,6 @@ #pragma once -#include "../pch.h" - namespace mongo { /** |