summaryrefslogtreecommitdiffstats
path: root/include/libtf/heap.h
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2010-03-10 13:58:39 +0200
committerTimo Teras <timo.teras@iki.fi>2010-03-10 13:58:39 +0200
commit5ef38570315dc68d7ddf8d9475d9a8830528e8a4 (patch)
treef88fc542b5231614ac6c22a75baea90d82449d6c /include/libtf/heap.h
parent43e69b26126b8708b70680c6b4806eb3844386ab (diff)
downloadlibtf-5ef38570315dc68d7ddf8d9475d9a8830528e8a4.tar.bz2
libtf-5ef38570315dc68d7ddf8d9475d9a8830528e8a4.tar.xz
libtf: separate scheduler fibre, change the core api
Diffstat (limited to 'include/libtf/heap.h')
-rw-r--r--include/libtf/heap.h10
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