diff options
Diffstat (limited to 'include/libtf/heap.h')
-rw-r--r-- | include/libtf/heap.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/libtf/heap.h b/include/libtf/heap.h index a68e01d..3a16159 100644 --- a/include/libtf/heap.h +++ b/include/libtf/heap.h @@ -74,4 +74,14 @@ int tf_heap_prealloc(struct tf_heap_head *head, uint32_t size) return 0; } +static inline +void tf_heap_destroy(struct tf_heap_head *head) +{ + if (head->item) + free(head->item); + head->item = NULL; + head->num_items = 0; + head->allocated = 0; +} + #endif |