MCPcopy Create free account
hub / github.com/cpputest/cpputest / start

Method start

src/CppUTest/TestMemoryAllocator.cpp:728–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726}
727
728void GlobalMemoryAccountant::start()
729{
730 if (mallocAllocator_ != NULLPTR)
731 FAIL("Global allocator start called twice!");
732
733 mallocAllocator_ = new AccountingTestMemoryAllocator(accountant_, getCurrentMallocAllocator());
734 newAllocator_ = new AccountingTestMemoryAllocator(accountant_, getCurrentNewAllocator());
735 newArrayAllocator_ = new AccountingTestMemoryAllocator(accountant_, getCurrentNewArrayAllocator());
736
737 accountant_.setAllocator(getCurrentMallocAllocator());
738
739 setCurrentMallocAllocator(mallocAllocator_);
740 setCurrentNewAllocator(newAllocator_);
741 setCurrentNewArrayAllocator(newArrayAllocator_);
742}
743
744void GlobalMemoryAccountant::restoreMemoryAllocators()
745{

Callers

nothing calls this directly

Calls 7

getCurrentNewAllocatorFunction · 0.85
setCurrentNewAllocatorFunction · 0.85
setAllocatorMethod · 0.45

Tested by

no test coverage detected