aboutsummaryrefslogtreecommitdiffstats
path: root/epan/emem.c
diff options
context:
space:
mode:
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2009-10-20 17:16:40 +0000
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2009-10-20 17:16:40 +0000
commitcf558b7c2f31af5cbc28a5e7d294c84ba9eeb144 (patch)
treec08e4c8d0a6220a29f10be939251d26506c3a268 /epan/emem.c
parent3a3baa90205e2b3389d3e53608a6612ed2196161 (diff)
Don't call xx_init_chunk() in ep_free_all() and se_free_all() if we're not
using chunks. With this change, xx_init_chunk() are only called once at startup (as their comments imply). Instead, set free_list to NULL in emem_free_all() (if we're not using chunks). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30644 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/emem.c')
-rw-r--r--epan/emem.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/epan/emem.c b/epan/emem.c
index 28a1bf6c41..9fb6fb3a95 100644
--- a/epan/emem.c
+++ b/epan/emem.c
@@ -1056,6 +1056,11 @@ emem_free_all(emem_header_t *mem)
}
}
+ if (!use_chunks) {
+ /* We've freed all this memory already */
+ mem->free_list = NULL;
+ }
+
/* release/reset all allocated trees */
for(tree_list=mem->trees;tree_list;tree_list=tree_list->next){
tree_list->tree=NULL;
@@ -1067,27 +1072,21 @@ void
ep_free_all(void)
{
emem_free_all(&ep_packet_mem);
-
- if (!ep_packet_mem.debug_use_chunks)
- ep_init_chunk();
}
/* release all allocated memory back to the pool. */
void
se_free_all(void)
{
-
#ifdef SHOW_EMEM_STATS
print_alloc_stats();
#endif
emem_free_all(&se_packet_mem);
-
- if (!se_packet_mem.debug_use_chunks)
- se_init_chunk();
}
-ep_stack_t ep_stack_new(void) {
+ep_stack_t
+ep_stack_new(void) {
ep_stack_t s = ep_new(struct _ep_stack_frame_t*);
*s = ep_new0(struct _ep_stack_frame_t);
return s;
@@ -1097,7 +1096,6 @@ ep_stack_t ep_stack_new(void) {
of allocating new ones.
*/
-
void *
ep_stack_push(ep_stack_t stack, void* data)
{