Lines Matching refs:heap
50 ot::Utils::Heap heap; in TestAllocateSingle() local
52 const size_t totalSize = heap.GetFreeSize(); in TestAllocateSingle()
55 void *p = heap.CAlloc(1, 0); in TestAllocateSingle()
56 …VerifyOrQuit(p == nullptr && totalSize == heap.GetFreeSize(), "TestAllocateSingle allocate 1 x 0 b… in TestAllocateSingle()
57 heap.Free(p); in TestAllocateSingle()
59 p = heap.CAlloc(0, 1); in TestAllocateSingle()
60 …VerifyOrQuit(p == nullptr && totalSize == heap.GetFreeSize(), "TestAllocateSingle allocate 0 x 1 b… in TestAllocateSingle()
61 heap.Free(p); in TestAllocateSingle()
64 for (size_t size = 1; size <= heap.GetCapacity(); ++size) in TestAllocateSingle()
67 void *p = heap.CAlloc(1, size); in TestAllocateSingle()
68 …VerifyOrQuit(p != nullptr && !heap.IsClean() && heap.GetFreeSize() + size <= totalSize, "allocatin… in TestAllocateSingle()
70 heap.Free(p); in TestAllocateSingle()
71 VerifyOrQuit(heap.IsClean() && heap.GetFreeSize() == totalSize, "freeing failed!\n"); in TestAllocateSingle()
89 ot::Utils::Heap heap; in TestAllocateRandomly() local
95 const size_t totalSize = heap.GetFreeSize(); in TestAllocateRandomly()
102 last->mNext = static_cast<Node *>(heap.CAlloc(1, size)); in TestAllocateRandomly()
132 heap.Free(curr); in TestAllocateRandomly()
149 heap.Free(last); in TestAllocateRandomly()
153 VerifyOrQuit(heap.IsClean() && heap.GetFreeSize() == totalSize, in TestAllocateRandomly()