23 #ifndef INCLUDED_ALLOCATORS_ALLOCATOR_CHECKER
24 #define INCLUDED_ALLOCATORS_ALLOCATOR_CHECKER
38 const Allocs::value_type item = std::make_pair(p, size);
39 std::pair<Allocs::iterator, bool> ret =
allocs.insert(item);
40 ENSURE(ret.second ==
true);
45 Allocs::iterator it =
allocs.find(p);
51 const size_t allocated_size = it->second;
52 ENSURE(size == allocated_size);
67 typedef std::map<void*, size_t>
Allocs;
71 #endif // #ifndef INCLUDED_ALLOCATORS_ALLOCATOR_CHECKER
std::map< void *, size_t > Allocs
void OnClear()
allocator is resetting itself, i.e.
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
void OnAllocate(void *p, size_t size)
#define DEBUG_WARN_ERR(status)
display the error dialog with text corresponding to the given error code.
void OnDeallocate(void *p, size_t size)