aboutsummaryrefslogtreecommitdiff
path: root/malloc/obstack.h
diff options
context:
space:
mode:
Diffstat (limited to 'malloc/obstack.h')
-rw-r--r--malloc/obstack.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/malloc/obstack.h b/malloc/obstack.h
index ad6b830fcb..49492eb73c 100644
--- a/malloc/obstack.h
+++ b/malloc/obstack.h
@@ -379,6 +379,11 @@ __extension__ \
_obstack_newchunk (__o, __len); \
(void) 0; })
+#define obstack_empty_p(OBSTACK) \
+ __extension__ \
+ ({ struct obstack *__o = (OBSTACK); \
+ (__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
+
#define obstack_grow(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
@@ -492,6 +497,9 @@ __extension__ \
#define obstack_room(h) \
(unsigned) ((h)->chunk_limit - (h)->next_free)
+#define obstack_empty_p(h) \
+ (h->chunk->prev == 0 && h->next_free - h->chunk->contents == 0)
+
/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
so that we can avoid having void expressions
in the arms of the conditional expression.