diff --git a/libstdc++-v3/libsupc++/eh_alloc.cc b/libstdc++-v3/libsupc++/eh_alloc.cc index c85b9aed40b..4060c9edf2e 100644 --- a/libstdc++-v3/libsupc++/eh_alloc.cc +++ b/libstdc++-v3/libsupc++/eh_alloc.cc @@ -80,6 +80,17 @@ namespace __gnu_cxx namespace { +#define NO_EH_ALLOC_POOL +#ifdef NO_EH_ALLOC_POOL + struct pool + { + static constexpr void* const arena = nullptr; + + static void *allocate (std::size_t) { return nullptr; } + static void free (void *) { } + static bool in_pool (void *) { return false; } + }; +#else // A fixed-size heap, variable size object allocator class pool { @@ -258,6 +269,7 @@ namespace return (p > arena && p < arena + arena_size); } +#endif pool emergency_pool; } @@ -267,11 +279,13 @@ namespace __gnu_cxx void __freeres() { +#ifndef NO_EH_ALLOC_POOL if (emergency_pool.arena) { ::free(emergency_pool.arena); emergency_pool.arena = 0; } +#endif } }