8#ifndef QDP_DEFAULT_ALLOCATOR
9#define QDP_DEFAULT_ALLOCATOR
13#if defined(QDP_DEBUG_MEMORY)
28#if defined(QDP_DEBUG_MEMORY)
31 MapVal(
unsigned char* u,
const std::string& f,
int l,
size_t b) :
32 unaligned(u), func(f), line(l), bytes(b) {}
34 unsigned char* unaligned;
43 typedef std::map<unsigned char*, MapVal>
MapT;
47 FuncInfo_t(
const char* f,
int l) : func(f), line(l) {}
53 typedef std::map<unsigned char*, unsigned char *>
MapT;
58 class QDPDefaultAllocator {
61#if defined(QDP_DEBUG_MEMORY)
62 std::stack<FuncInfo_t> infostack;
65 MapT the_alignment_map;
68 QDPDefaultAllocator(
const QDPDefaultAllocator& c) {}
71 void operator=(
const QDPDefaultAllocator& c) {}
77 QDPDefaultAllocator() {}
78 ~QDPDefaultAllocator() {}
84 void
init(size_t PoolSizeinMB);
87 void
pushFunc(const char* func, int line);
96 allocate(size_t n_bytes,const MemoryPoolHint& mem_pool_hint);
void init(size_t PoolSizeinMB)
void free(void *mem)
Free an aligned pointer, which was allocated by us.
void pushFunc(const char *func, int line)
void * allocate(size_t n_bytes, const MemoryPoolHint &mem_pool_hint)
std::map< unsigned char *, unsigned char * > MapT
Yet another random number generator.
Catch-alls for all memory allocators.
Parallel version of stdio.