alloc.h (Firebird-3.0.2.32703-0.tar.bz2) | : | alloc.h (Firebird-3.0.4.33054-0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 70 | skipping to change at line 70 | |||
#ifdef USE_SYSTEM_NEW | #ifdef USE_SYSTEM_NEW | |||
#define OOM_EXCEPTION std::bad_alloc | #define OOM_EXCEPTION std::bad_alloc | |||
#else | #else | |||
#define OOM_EXCEPTION Firebird::BadAlloc | #define OOM_EXCEPTION Firebird::BadAlloc | |||
#endif | #endif | |||
namespace Firebird { | namespace Firebird { | |||
// Alignment for all memory blocks | // Alignment for all memory blocks | |||
const size_t ALLOC_ALIGNMENT = 8; | #define ALLOC_ALIGNMENT 16 | |||
static inline size_t MEM_ALIGN(size_t value) | static inline size_t MEM_ALIGN(size_t value) | |||
{ | { | |||
return FB_ALIGN(value, ALLOC_ALIGNMENT); | return FB_ALIGN(value, ALLOC_ALIGNMENT); | |||
} | } | |||
class MemPool; | class MemPool; | |||
class MemoryStats | class MemoryStats | |||
{ | { | |||
skipping to change at line 213 | skipping to change at line 213 | |||
// Set context pool for current thread of execution | // Set context pool for current thread of execution | |||
static MemoryPool* setContextPool(MemoryPool* newPool); | static MemoryPool* setContextPool(MemoryPool* newPool); | |||
// Get context pool for current thread of execution | // Get context pool for current thread of execution | |||
static MemoryPool* getContextPool(); | static MemoryPool* getContextPool(); | |||
// Set statistics group for pool. Usage counters will be decremented from | // Set statistics group for pool. Usage counters will be decremented from | |||
// previously set group and added to new | // previously set group and added to new | |||
void setStatsGroup(MemoryStats& stats) throw (); | void setStatsGroup(MemoryStats& stats) throw (); | |||
// Just a helper for AutoPtr. | ||||
static void clear(MemoryPool* pool) | ||||
{ | ||||
deletePool(pool); | ||||
} | ||||
// Initialize and finalize global memory pool | // Initialize and finalize global memory pool | |||
static void init(); | static void init(); | |||
static void cleanup(); | static void cleanup(); | |||
// Initialize context pool | // Initialize context pool | |||
static void contextPoolInit(); | static void contextPoolInit(); | |||
// Print out pool contents. This is debugging routine | // Print out pool contents. This is debugging routine | |||
static const unsigned PRINT_USED_ONLY = 0x01; | static const unsigned PRINT_USED_ONLY = 0x01; | |||
static const unsigned PRINT_RECURSIVE = 0x02; | static const unsigned PRINT_RECURSIVE = 0x02; | |||
skipping to change at line 441 | skipping to change at line 435 | |||
AutoStorage() | AutoStorage() | |||
: PermanentStorage(getAutoMemoryPool()) | : PermanentStorage(getAutoMemoryPool()) | |||
{ | { | |||
#if defined(DEV_BUILD) | #if defined(DEV_BUILD) | |||
ProbeStack(); | ProbeStack(); | |||
#endif | #endif | |||
} | } | |||
explicit AutoStorage(MemoryPool& p) : PermanentStorage(p) { } | explicit AutoStorage(MemoryPool& p) : PermanentStorage(p) { } | |||
}; | }; | |||
typedef AutoPtr<MemoryPool, MemoryPool> AutoMemoryPool; | template <> | |||
inline void SimpleDelete<MemoryPool>::clear(MemoryPool* pool) | ||||
{ | ||||
if (pool) | ||||
MemoryPool::deletePool(pool); | ||||
} | ||||
typedef AutoPtr<MemoryPool> AutoMemoryPool; | ||||
} // namespace Firebird | } // namespace Firebird | |||
#endif // CLASSES_ALLOC_H | #endif // CLASSES_ALLOC_H | |||
End of changes. 3 change blocks. | ||||
8 lines changed or deleted | 9 lines changed or added |