Lines Matching full:heap
19 /* Simple, fast heap implementation.
39 * the chunk is always returned immediately to the heap for other
51 * have somewhere to put the arguments. The actual heap metadata at
52 * runtime lives in the heap memory itself and this struct simply
58 struct z_heap *heap; member
71 * @defgroup low_level_heap_allocator Low Level Heap Allocator
81 * @param heap Pointer to specified sys_heap
85 int sys_heap_runtime_stats_get(struct sys_heap *heap,
89 * @brief Reset the maximum heap usage.
94 * @param heap Pointer to sys_heap
97 int sys_heap_runtime_stats_reset_max(struct sys_heap *heap);
105 * @param heap Heap to initialize
109 void sys_heap_init(struct sys_heap *heap, void *mem, size_t bytes);
113 * Returns a pointer to a block of unused memory in the heap. This
121 * No two sys_heap functions should operate on the same heap at the
124 * @param heap Heap from which to allocate
128 void *sys_heap_alloc(struct sys_heap *heap, size_t bytes);
136 * The resulting memory can be returned to the heap using sys_heap_free().
138 * @param heap Heap from which to allocate
143 void *sys_heap_aligned_alloc(struct sys_heap *heap, size_t align, size_t bytes);
152 * No two sys_heap functions should operate on the same heap at the
155 * @param heap Heap to which to return the memory
158 void sys_heap_free(struct sys_heap *heap, void *mem);
168 * the remaining memory returned to the heap. If the allocation of a
172 * @param heap Heap from which to allocate
178 void *sys_heap_aligned_realloc(struct sys_heap *heap, void *ptr,
181 #define sys_heap_realloc(heap, ptr, bytes) \ argument
182 sys_heap_aligned_realloc(heap, ptr, 0, bytes)
188 * returned is the size of the heap-managed memory, which may be
190 * granularity. The heap code is guaranteed to make no access to this
194 * @param heap Heap containing the block
195 * @param mem Pointer to memory allocated from this heap
198 size_t sys_heap_usable_size(struct sys_heap *heap, void *mem);
200 /** @brief Validate heap integrity
206 * true then the heap is in a consistent state and can correctly
210 * @param heap Heap to validate
211 * @return true, if the heap is valid, otherwise false
214 bool sys_heap_validate(struct sys_heap *heap);
216 static inline bool sys_heap_validate(struct sys_heap *heap) in sys_heap_validate() argument
218 ARG_UNUSED(heap); in sys_heap_validate()
225 * Test rig for heap allocation validation. This will loop for @a
228 * heuristics designed to keep the heap in a state where it is near @a
230 * by the caller as callbacks (i.e. this can in theory test any heap).
240 * @param total_bytes Size of the byte array the heap was initialized in
243 * test. Should be about 1/2 the size of the heap
249 * failures and a very fragmented heap.
260 /** @brief Print heap internal structure information to the console
262 * Print information on the heap structure such as its size, chunk buckets,
265 * @param heap Heap to print information about
266 * @param dump_chunks True to print the entire heap chunk list
268 void sys_heap_print_info(struct sys_heap *heap, bool dump_chunks);