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;
allocator test rig.
Definition: allocator_checker.h:34
void OnAllocate(void *p, size_t size)
Definition: allocator_checker.h:36
Allocs allocs
Definition: allocator_checker.h:68
void OnDeallocate(void *p, size_t size)
Definition: allocator_checker.h:43
std::map< void *, size_t > Allocs
Definition: allocator_checker.h:67
void OnClear()
allocator is resetting itself, i.e.
Definition: allocator_checker.h:61
#define DEBUG_WARN_ERR(status)
display the error dialog with text corresponding to the given error code.
Definition: debug.h:326
#define ENSURE(expr)
ensure the expression <expr> evaluates to non-zero.
Definition: debug.h:277
const Status LOGIC
Definition: status.h:411