62 * Constructs a new testing allocator. |
62 * Constructs a new testing allocator. |
63 */ |
63 */ |
64 CxTestingAllocator(); |
64 CxTestingAllocator(); |
65 |
65 |
66 /** |
66 /** |
|
67 * Verifies that this allocator has been used. |
|
68 * |
|
69 * @return true if any allocation was attempted using this allocator |
|
70 */ |
|
71 [[nodiscard]] bool used() const; |
|
72 |
|
73 /** |
67 * Verifies that all allocated memory blocks are freed and no free occurred twice. |
74 * Verifies that all allocated memory blocks are freed and no free occurred twice. |
68 * |
75 * |
69 * @return true iff all tracked allocations / deallocations were valid |
76 * @return true iff all tracked allocations / deallocations were valid |
70 */ |
77 */ |
71 bool verify() const; |
78 [[nodiscard]] bool verify() const; |
72 }; |
79 }; |
73 |
80 |
74 #endif /* UCX_UTIL_ALLOCATOR_H */ |
81 #endif /* UCX_UTIL_ALLOCATOR_H */ |