1 /* 2 * Copyright (c) 2015 Travis Geiselbrecht 3 * 4 * Use of this source code is governed by a MIT-style 5 * license that can be found in the LICENSE file or at 6 * https://opensource.org/licenses/MIT 7 */ 8 #pragma once 9 10 #include <lk/compiler.h> 11 12 __BEGIN_CDECLS 13 14 struct miniheap_stats { 15 void *heap_start; 16 size_t heap_len; 17 size_t heap_free; 18 size_t heap_max_chunk; 19 size_t heap_low_watermark; 20 }; 21 22 void miniheap_get_stats(struct miniheap_stats *ptr); 23 24 void *miniheap_alloc(size_t, unsigned int alignment); 25 void *miniheap_realloc(void *, size_t); 26 void miniheap_free(void *); 27 28 void miniheap_init(void *ptr, size_t len); 29 void miniheap_dump(void); 30 void miniheap_trim(void); 31 32 __END_CDECLS 33