diff options
author | Evan Huus <eapache@gmail.com> | 2013-01-23 00:59:38 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-01-23 00:59:38 +0000 |
commit | c25c5915c5c94b5c70e51e4ca43f1aa5286c6349 (patch) | |
tree | f7b37ff1377a32fc0354b1a378b64eb90df3a9f2 /epan/wmem | |
parent | ae61fe0158bd3afc2cfc034e81199cc7a39c2585 (diff) |
Add wrapper functions for realloc, free and gc, but don't expose them in the
header yet as not all allocators implement them.
svn path=/trunk/; revision=47219
Diffstat (limited to 'epan/wmem')
-rw-r--r-- | epan/wmem/wmem_core.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/epan/wmem/wmem_core.c b/epan/wmem/wmem_core.c index 0311ce0a6d..0cb8c64aed 100644 --- a/epan/wmem/wmem_core.c +++ b/epan/wmem/wmem_core.c @@ -50,6 +50,18 @@ wmem_alloc0(wmem_allocator_t *allocator, const size_t size) return memset(buf, 0, size); } +void * +wmem_realloc(wmem_allocator_t *allocator, void *ptr, const size_t size) +{ + return allocator->realloc(allocator->private_data, ptr, size); +} + +void +wmem_free(wmem_allocator_t *allocator, void *ptr) +{ + allocator->free(allocator->private_data, ptr); +} + void wmem_free_all(wmem_allocator_t *allocator) { @@ -57,6 +69,12 @@ wmem_free_all(wmem_allocator_t *allocator) } void +wmem_gc(wmem_allocator_t *allocator) +{ + allocator->gc(allocator->private_data); +} + +void wmem_destroy_allocator(wmem_allocator_t *allocator) { wmem_free_all(allocator); |