summaryrefslogtreecommitdiff
path: root/epan/wmem/wmem_stack.h
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2012-12-19 01:37:28 +0000
committerEvan Huus <eapache@gmail.com>2012-12-19 01:37:28 +0000
commit3739c083bf6de622413e844f2c663a95cfdf895d (patch)
tree163ed85c4acfc866cd9d75dc4425525498418d9a /epan/wmem/wmem_stack.h
parent77d69b36b208dff05f91cc23d0e1247036c4a03d (diff)
downloadwireshark-3739c083bf6de622413e844f2c663a95cfdf895d.tar.gz
Implement a basic singly-linked for wmem.
Re-implement the stack as a wrapper for that. svn path=/trunk/; revision=46607
Diffstat (limited to 'epan/wmem/wmem_stack.h')
-rw-r--r--epan/wmem/wmem_stack.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/epan/wmem/wmem_stack.h b/epan/wmem/wmem_stack.h
index 42ed4f3295..a11c26f584 100644
--- a/epan/wmem/wmem_stack.h
+++ b/epan/wmem/wmem_stack.h
@@ -30,17 +30,16 @@
#include <glib.h>
#include "wmem_core.h"
+#include "wmem_slist.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
-struct _wmem_stack_t;
+/* Wmem stack is implemented as a simple wrapper over Wmem slist */
+typedef wmem_slist_t wmem_stack_t;
-typedef struct _wmem_stack_t wmem_stack_t;
-
-guint
-wmem_stack_count(const wmem_stack_t *stack);
+#define wmem_stack_count(X) wmem_slist_count(X)
void *
wmem_stack_peek(const wmem_stack_t *stack);
@@ -51,8 +50,7 @@ wmem_stack_pop(wmem_stack_t *stack);
void
wmem_stack_push(wmem_stack_t *stack, void *data);
-wmem_stack_t *
-wmem_stack_new(wmem_allocator_t *allocator);
+#define wmem_stack_new(ALLOCATOR) wmem_slist_new(ALLOCATOR)
#ifdef __cplusplus
}