8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 00:43:02 +01:00

Fixed warnings by VC14

warning C4595: 'operator new': non-member operator new or delete functions may not be declared inline
This commit is contained in:
hvlad 2017-10-13 15:58:38 +03:00
parent c83f7e535b
commit ce66904ebf
2 changed files with 21 additions and 17 deletions

View File

@ -67,6 +67,23 @@
#define VALGRIND_FIX_IT // overrides suspicious valgrind behavior
#endif // USE_VALGRIND
void* operator new(size_t s ALLOC_PARAMS) throw (OOM_EXCEPTION)
{
return MemoryPool::globalAlloc(s ALLOC_PASS_ARGS);
}
void* operator new[](size_t s ALLOC_PARAMS) throw (OOM_EXCEPTION)
{
return MemoryPool::globalAlloc(s ALLOC_PASS_ARGS);
}
void operator delete(void* mem ALLOC_PARAMS) throw()
{
MemoryPool::globalFree(mem);
}
void operator delete[](void* mem ALLOC_PARAMS) throw()
{
MemoryPool::globalFree(mem);
}
namespace {
/*** emergency debugging stuff

View File

@ -294,15 +294,11 @@ private:
using Firebird::MemoryPool;
// operators new and delete
extern void* operator new(size_t s ALLOC_PARAMS) throw (OOM_EXCEPTION);
extern void* operator new[](size_t s ALLOC_PARAMS) throw (OOM_EXCEPTION);
extern void operator delete(void* mem ALLOC_PARAMS) throw();
extern void operator delete[](void* mem ALLOC_PARAMS) throw();
inline void* operator new(size_t s ALLOC_PARAMS) throw (OOM_EXCEPTION)
{
return MemoryPool::globalAlloc(s ALLOC_PASS_ARGS);
}
inline void* operator new[](size_t s ALLOC_PARAMS) throw (OOM_EXCEPTION)
{
return MemoryPool::globalAlloc(s ALLOC_PASS_ARGS);
}
inline void* operator new(size_t s, Firebird::MemoryPool& pool ALLOC_PARAMS) throw (OOM_EXCEPTION)
{
@ -313,15 +309,6 @@ inline void* operator new[](size_t s, Firebird::MemoryPool& pool ALLOC_PARAMS) t
return pool.allocate(s ALLOC_PASS_ARGS);
}
inline void operator delete(void* mem ALLOC_PARAMS) throw()
{
MemoryPool::globalFree(mem);
}
inline void operator delete[](void* mem ALLOC_PARAMS) throw()
{
MemoryPool::globalFree(mem);
}
inline void operator delete(void* mem, Firebird::MemoryPool& pool ALLOC_PARAMS) throw()
{
MemoryPool::globalFree(mem);