From b1e9feb5272130f48ee58dadfcabc6e784548939 Mon Sep 17 00:00:00 2001 From: mapopa Date: Wed, 3 Jun 2015 08:22:32 +0000 Subject: [PATCH] Libreoffice patch : C++11: new/delete replacement functions cannot be inline https://www.mail-archive.com/libreoffice@lists.freedesktop.org/msg79870.html --- src/common/classes/alloc.cpp | 18 ++++++++++++++++++ src/common/classes/alloc.h | 20 ++++---------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/common/classes/alloc.cpp b/src/common/classes/alloc.cpp index 41c242b791..5e91675859 100644 --- a/src/common/classes/alloc.cpp +++ b/src/common/classes/alloc.cpp @@ -2103,3 +2103,21 @@ void AutoStorage::ProbeStack() const #endif } // namespace Firebird + +void* operator new(size_t s) THROW_BAD_ALLOC +{ + return Firebird::MemoryPool::globalAlloc(s); +} +void* operator new[](size_t s) THROW_BAD_ALLOC +{ + return Firebird::MemoryPool::globalAlloc(s); +} + +void operator delete(void* mem) throw() +{ + Firebird::MemoryPool::globalFree(mem); +} +void operator delete[](void* mem) throw() +{ + Firebird::MemoryPool::globalFree(mem); +} diff --git a/src/common/classes/alloc.h b/src/common/classes/alloc.h index 8684b3d88a..6d4136235e 100644 --- a/src/common/classes/alloc.h +++ b/src/common/classes/alloc.h @@ -492,23 +492,11 @@ using Firebird::MemoryPool; inline static MemoryPool* getDefaultMemoryPool() { return Firebird::MemoryPool::processMemoryPool; } // Global versions of operators new and delete -inline void* operator new(size_t s) THROW_BAD_ALLOC -{ - return Firebird::MemoryPool::globalAlloc(s); -} -inline void* operator new[](size_t s) THROW_BAD_ALLOC -{ - return Firebird::MemoryPool::globalAlloc(s); -} +void* operator new(size_t s) THROW_BAD_ALLOC; +void* operator new[](size_t s) THROW_BAD_ALLOC; -inline void operator delete(void* mem) throw() -{ - Firebird::MemoryPool::globalFree(mem); -} -inline void operator delete[](void* mem) throw() -{ - Firebird::MemoryPool::globalFree(mem); -} +void operator delete(void* mem) throw(); +void operator delete[](void* mem) throw(); #ifdef DEBUG_GDS_ALLOC inline void* operator new(size_t s, Firebird::MemoryPool& pool, const char* file, int line)