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

Move function definition from header to cpp and remove inline.

This commit is contained in:
brodsom 2003-02-16 00:20:30 +00:00
parent 3aa99e5a54
commit 01681a01dc
4 changed files with 53 additions and 37 deletions

View File

@ -41,6 +41,31 @@
#define PATTERN_FILL(ptr,size,pattern) ((void)0)
#endif
// Moved from header
#ifndef TESTING_ONLY
#ifdef DEBUG_GDS_ALLOC
void* operator new(size_t s, Firebird::MemoryPool& pool, char* file, int line) {
return pool.allocate(s, 0, file, line);
// return pool.calloc(s, 0, file, line);
}
void* operator new[](size_t s, Firebird::MemoryPool& pool, char* file, int line) {
return pool.allocate(s, 0, file, line);
// return pool.calloc(s, 0, file, line);
}
#else
void* operator new(size_t s, Firebird::MemoryPool& pool) throw(std::bad_alloc) {
return pool.allocate(s);
// return pool.calloc(s);
}
void* operator new[](size_t s, Firebird::MemoryPool& pool) throw(std::bad_alloc) {
return pool.allocate(s);
// return pool.calloc(s);
}
#endif
#endif
// TODO (in order of importance):
// 1. local pool locking +
// 2. line number debug info +

View File

@ -230,29 +230,18 @@ void* operator new(size_t);
void* operator new[](size_t);
#ifdef DEBUG_GDS_ALLOC
inline void* operator new(size_t s, Firebird::MemoryPool& pool, char* file, int line) {
return pool.allocate(s, 0, file, line);
// return pool.calloc(s, 0, file, line);
}
inline void* operator new[](size_t s, Firebird::MemoryPool& pool, char* file, int line) {
return pool.allocate(s, 0, file, line);
// return pool.calloc(s, 0, file, line);
}
void* operator new(size_t s, Firebird::MemoryPool& pool, char* file, int line);
void* operator new[](size_t s, Firebird::MemoryPool& pool, char* file, int line);
#define FB_NEW(pool) new(pool,__FILE__,__LINE__)
#define FB_NEW_RPT(pool,count) new(pool,count,__FILE__,__LINE__)
#else
inline void* operator new(size_t s, Firebird::MemoryPool& pool) throw(std::bad_alloc) {
return pool.allocate(s);
// return pool.calloc(s);
}
inline void* operator new[](size_t s, Firebird::MemoryPool& pool) throw(std::bad_alloc) {
return pool.allocate(s);
// return pool.calloc(s);
}
void* operator new(size_t s, Firebird::MemoryPool& pool) throw(std::bad_alloc);
void* operator new[](size_t s, Firebird::MemoryPool& pool) throw(std::bad_alloc);
#define FB_NEW(pool) new(pool)
#define FB_NEW_RPT(pool,count) new(pool,count)
#endif
// We cannot use inline versions because we have to replace STL delete defined in <new> header
// One more performance pain we have to take because of STL usage :((
void operator delete(void* mem) throw();

View File

@ -298,6 +298,28 @@ extern int main_gsec(SVC service);
#define MAIN_GSEC NULL
#endif
void SVC_STATUS_ARG(STATUS*& status, USHORT type, const void* value)
{
if (value)
{
switch (type)
{
case isc_arg_number:
*status++ = type;
*status++ = reinterpret_cast<STATUS>(value);
break;
case isc_arg_string:
*status++ = type;
*status++ = (STATUS)
SVC_err_string(static_cast<const char*>(value),
strlen(static_cast<const char*>(value)));
break;
default:
break;
}
}
}
/* Entries which have a NULL serv_executable field will not fork
a process on the server, but will establish a valid connection
which can be used for isc_info_svc calls.

View File

@ -114,27 +114,7 @@ extern "C" {
#endif /* SUPERSERVER */
inline void SVC_STATUS_ARG(STATUS*& status, USHORT type, const void* value)
{
if (value)
{
switch (type)
{
case isc_arg_number:
*status++ = type;
*status++ = reinterpret_cast<STATUS>(value);
break;
case isc_arg_string:
*status++ = type;
*status++ = (STATUS)
SVC_err_string(static_cast<const char*>(value),
strlen(static_cast<const char*>(value)));
break;
default:
break;
}
}
}
void SVC_STATUS_ARG(STATUS*& status, USHORT type, const void* value);
#define CK_SPACE_FOR_NUMERIC {{if ((info + 1 + sizeof (ULONG)) > end) \
{ \