diff options
author | Evan Huus <eapache@gmail.com> | 2013-03-10 15:04:04 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-03-10 15:04:04 +0000 |
commit | 7f738de7b4039805846c8ea1befd2b41c6580231 (patch) | |
tree | e6879f63059b0d2623915bee3d6cd944db156ba9 /epan/wmem/wmem_allocator_simple.c | |
parent | bbb405895492350914eb559179ef30a10ab49ac2 (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_simple.c')
-rw-r--r-- | epan/wmem/wmem_allocator_simple.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/wmem/wmem_allocator_simple.c b/epan/wmem/wmem_allocator_simple.c index 0a717a2c29..f872db88b1 100644 --- a/epan/wmem/wmem_allocator_simple.c +++ b/epan/wmem/wmem_allocator_simple.c @@ -117,8 +117,8 @@ wmem_simple_allocator_destroy(wmem_allocator_t *allocator) private_allocator = (wmem_simple_allocator_t*) allocator->private_data; g_hash_table_destroy(private_allocator->block_table); - g_free(private_allocator); - g_free(allocator); + g_slice_free(wmem_simple_allocator_t, private_allocator); + g_slice_free(wmem_allocator_t, allocator); } wmem_allocator_t * @@ -127,8 +127,8 @@ wmem_simple_allocator_new(void) wmem_allocator_t *allocator; wmem_simple_allocator_t *simple_allocator; - allocator = g_new(wmem_allocator_t, 1); - simple_allocator = g_new(wmem_simple_allocator_t, 1); + allocator = g_slice_new(wmem_allocator_t); + simple_allocator = g_slice_new(wmem_simple_allocator_t); allocator->private_data = (void*) simple_allocator; |