mem_mgr.hpp

This header file defines memory management functions for aligned allocation and deallocation using placement new and object destructor calls. These functions provide an alternative to using new and delete for memory management.

Functions

template<class ValueType>
Iterator<ValueType> sctl::aligned_new(Long n_elem = 1, const MemoryManager *mem_mgr = &MemoryManager::glbMemMgr())

Aligned allocation as an alternative to new. Uses placement new to construct objects. The returned iterator must be released via aligned_delete, so discarding it leaks the allocation.

template<class ValueType>
void sctl::aligned_delete(Iterator<ValueType> A, const MemoryManager *mem_mgr = &MemoryManager::glbMemMgr())

Aligned de-allocation as an alternative to delete. Calls the object destructor.