aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wmem/wmem_list.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-12-24 01:17:41 +0000
committerEvan Huus <eapache@gmail.com>2013-12-24 01:17:41 +0000
commit1dfa4e2697c058482d29ae6985583e3a99ff31f1 (patch)
tree65d72e6aedb0740bf23a8bd73101dd281e137767 /epan/wmem/wmem_list.c
parent5f91a0afc7aabda4670bfb20616af6cbbfd0360d (diff)
Add wmem_destroy_list, wmem_destroy_queue, wmem_destroy_stack so that those
data-structures can be used with manually managed memory. svn path=/trunk/; revision=54432
Diffstat (limited to 'epan/wmem/wmem_list.c')
-rw-r--r--epan/wmem/wmem_list.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/epan/wmem/wmem_list.c b/epan/wmem/wmem_list.c
index df9f07ceee..592d51b432 100644
--- a/epan/wmem/wmem_list.c
+++ b/epan/wmem/wmem_list.c
@@ -173,6 +173,22 @@ wmem_list_new(wmem_allocator_t *allocator)
return list;
}
+void
+wmem_destroy_list(wmem_list_t *list)
+{
+ wmem_list_frame_t *cur, *next;
+
+ cur = list->head;
+
+ while (cur) {
+ next = cur->next;
+ wmem_free(list->allocator, cur);
+ cur = next;
+ }
+
+ wmem_free(list->allocator, list);
+}
+
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*