aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wmem
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-01-04 22:11:13 +0000
committerEvan Huus <eapache@gmail.com>2013-01-04 22:11:13 +0000
commitbab105d094c6fd89ee542d36f6777681ae96f68b (patch)
tree5b073ae11ab8212b03669e475a0f79e4565bde90 /epan/wmem
parentc16ab7b57e60c34b6c911565013e5fa103ee2305 (diff)
Add convenience macros wmem_new and wmem_new0
svn path=/trunk/; revision=46941
Diffstat (limited to 'epan/wmem')
-rw-r--r--epan/wmem/wmem_core.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/wmem/wmem_core.h b/epan/wmem/wmem_core.h
index ad71591252..b0fdac9873 100644
--- a/epan/wmem/wmem_core.h
+++ b/epan/wmem/wmem_core.h
@@ -40,13 +40,15 @@ typedef enum _wmem_allocator_type_t {
struct _wmem_allocator_t;
-typedef struct _wmem_allocator_t wmem_allocator_t;
+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)))
void *
wmem_alloc0(wmem_allocator_t *allocator, const size_t size);
+#define wmem_new0(allocator, type) ((type*)wmem_alloc0((allocator), sizeof(type)))
void
wmem_free_all(wmem_allocator_t *allocator);