aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wmem/wmem_allocator_block.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-03-10 15:04:04 +0000
committerEvan Huus <eapache@gmail.com>2013-03-10 15:04:04 +0000
commit7f738de7b4039805846c8ea1befd2b41c6580231 (patch)
treee6879f63059b0d2623915bee3d6cd944db156ba9 /epan/wmem/wmem_allocator_block.c
parentbbb405895492350914eb559179ef30a10ab49ac2 (diff)
Glib docs recommend using the slice API if you know you won't need to realloc.
svn path=/trunk/; revision=48228
Diffstat (limited to 'epan/wmem/wmem_allocator_block.c')
-rw-r--r--epan/wmem/wmem_allocator_block.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/wmem/wmem_allocator_block.c b/epan/wmem/wmem_allocator_block.c
index 10d7b70daa..45829b3846 100644
--- a/epan/wmem/wmem_allocator_block.c
+++ b/epan/wmem/wmem_allocator_block.c
@@ -762,8 +762,8 @@ wmem_block_allocator_destroy(wmem_allocator_t *allocator)
wmem_block_gc(real_allocator);
/* then just free the allocator structs */
- g_free(real_allocator);
- g_free(allocator);
+ g_slice_free(wmem_block_allocator_t, real_allocator);
+ g_slice_free(wmem_allocator_t, allocator);
}
wmem_allocator_t *
@@ -772,8 +772,8 @@ wmem_block_allocator_new(void)
wmem_allocator_t *allocator;
wmem_block_allocator_t *block_allocator;
- allocator = g_new(wmem_allocator_t, 1);
- block_allocator = g_new(wmem_block_allocator_t, 1);
+ allocator = g_slice_new(wmem_allocator_t);
+ block_allocator = g_slice_new(wmem_block_allocator_t);
allocator->private_data = (void*) block_allocator;