19#include "pw_allocator/allocator.h"
20#include "pw_containers/vector.h"
21#include "pw_random/random.h"
23namespace pw::allocator::test {
43 std::variant<AllocationRequest, DeallocationRequest, ReallocationRequest>;
47size_t AlignmentFromLShift(
size_t lshift,
size_t size);
117 : allocations_(allocations) {}
131 void AddAllocation(
void* ptr,
Layout layout);
136 Allocation RemoveAllocation(
size_t index);
142 Vector<Allocation>& allocations_;
145 size_t num_requests_ = 0;
177template <
size_t kMaxConcurrentAllocations>
183 Vector<Allocation, kMaxConcurrentAllocations> allocations_;
Definition: allocator.h:32
Definition: test_harness.h:58
void HandleRequests(const Vector< Request > &requests)
void GenerateRequests(random::RandomGenerator &prng, size_t max_size, size_t num_requests)
virtual ~TestHarnessGeneric()=default
void GenerateRequest(random::RandomGenerator &prng, size_t max_size)
void Reset()
Deallocates any pointers stored in the vector of allocated pointers.
void HandleRequest(const Request &request)
Definition: test_harness.h:178
Represents a request to allocate some memory.
Definition: test_harness.h:26
Represents a request to free some allocated memory.
Definition: test_harness.h:32
Represents a request to reallocate allocated memory with a new size.
Definition: test_harness.h:37
Associates a pointer to memory with the Layout used to allocate it.
Definition: test_harness.h:111