diff options
author | Evan Huus <eapache@gmail.com> | 2013-02-08 01:47:48 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-02-08 01:47:48 +0000 |
commit | b636b8864639e07b589cc7cf7f22c48ee6c96e5e (patch) | |
tree | 2def93fb20ae2412b314aa64f60bed72d25f4739 /epan/wmem/wmem_core.h | |
parent | eea6cb6315b1abf00671d2ef135a7b0f052f9a9e (diff) | |
download | wireshark-b636b8864639e07b589cc7cf7f22c48ee6c96e5e.tar.gz |
Expose the new wmem API functions, and use a consistent order of
alloc/free/realloc across all of wmem.
svn path=/trunk/; revision=47548
Diffstat (limited to 'epan/wmem/wmem_core.h')
-rw-r--r-- | epan/wmem/wmem_core.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/epan/wmem/wmem_core.h b/epan/wmem/wmem_core.h index b0fdac9873..f4242c2846 100644 --- a/epan/wmem/wmem_core.h +++ b/epan/wmem/wmem_core.h @@ -44,16 +44,27 @@ typedef struct _wmem_allocator_t wmem_allocator_t; void * wmem_alloc(wmem_allocator_t *allocator, const size_t size); -#define wmem_new(allocator, type) ((type*)wmem_alloc((allocator), sizeof(type))) +#define wmem_new(allocator, type) \ + ((type*)wmem_alloc((allocator), sizeof(type))) void * wmem_alloc0(wmem_allocator_t *allocator, const size_t size); -#define wmem_new0(allocator, type) ((type*)wmem_alloc0((allocator), sizeof(type))) +#define wmem_new0(allocator, type) \ + ((type*)wmem_alloc0((allocator), sizeof(type))) + +void +wmem_free(wmem_allocator_t *allocator, void *ptr); + +void * +wmem_realloc(wmem_allocator_t *allocator, void *ptr, const size_t size); void wmem_free_all(wmem_allocator_t *allocator); void +wmem_gc(wmem_allocator_t *allocator); + +void wmem_destroy_allocator(wmem_allocator_t *allocator); wmem_allocator_t * |