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