diff options
author | wfh@chromium.org <wfh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-15 19:37:13 +0000 |
---|---|---|
committer | wfh@chromium.org <wfh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-15 19:37:13 +0000 |
commit | f1e33fb052cdefa4579c6d05869785bfdf4ffca3 (patch) | |
tree | 3d1a9702591ee75716cb1ccc1a656cfc455dd0df /base | |
parent | 3c61b0632c0eb82923e22494f5c5ac8dd1b9177a (diff) | |
download | chromium_src-f1e33fb052cdefa4579c6d05869785bfdf4ffca3.zip chromium_src-f1e33fb052cdefa4579c6d05869785bfdf4ffca3.tar.gz chromium_src-f1e33fb052cdefa4579c6d05869785bfdf4ffca3.tar.bz2 |
Change call_new_handler to be non extern C; not called outside this code and it's causing issues with the linker on Win-64
BUG=166496
Review URL: https://chromiumcodereview.appspot.com/12256047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182788 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/allocator/allocator_shim.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc index 8801e4c..1d82291 100644 --- a/base/allocator/allocator_shim.cc +++ b/base/allocator/allocator_shim.cc @@ -73,8 +73,6 @@ bool je_malloc_init_hard(); void* je_memalign(size_t a, size_t s); } -extern "C" { - // Call the new handler, if one has been set. // Returns true on successfully calling the handler, false otherwise. inline bool call_new_handler(bool nothrow) { @@ -88,7 +86,8 @@ inline bool call_new_handler(bool nothrow) { nh = std::set_new_handler(0); (void) std::set_new_handler(nh); } -#if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || (defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS) +#if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || \ + (defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS) if (!nh) return false; // Since exceptions are disabled, we don't really know if new_handler @@ -99,7 +98,7 @@ inline bool call_new_handler(bool nothrow) { // If no new_handler is established, the allocation failed. if (!nh) { if (nothrow) - return 0; + return false; throw std::bad_alloc(); } // Otherwise, try the new_handler. If it returns, retry the @@ -113,8 +112,10 @@ inline bool call_new_handler(bool nothrow) { return true; } #endif // (defined(__GNUC__) && !defined(__EXCEPTIONS)) || (defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS) + return false; } +extern "C" { void* malloc(size_t size) __THROW { void* ptr; for (;;) { |