From f7be7da410497a8a1ce8b424d725303848d0baa5 Mon Sep 17 00:00:00 2001 From: Jeffrey Kegler Date: Mon, 28 May 2012 22:28:20 -0700 Subject: [PATCH] Work on obstack debugging --- r2/libmarpa/dev/marpa_obs.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/r2/libmarpa/dev/marpa_obs.c b/r2/libmarpa/dev/marpa_obs.c index c2322ad91..c5d6ed39c 100644 --- a/r2/libmarpa/dev/marpa_obs.c +++ b/r2/libmarpa/dev/marpa_obs.c @@ -69,8 +69,11 @@ enum }; #define DEBUG_CONTENTS_OFFSET \ - offsetof(struct { struct chunk_header header; union worst_aligned_object contents}, \ - contents) + offsetof( \ + struct { \ + struct obstack_chunk_header header; \ + union worst_aligned_object contents; \ + }, contents) /* Initialize an obstack H for use. Specify chunk size SIZE (0 means default). Objects start on multiples of ALIGNMENT (0 means use default). @@ -83,7 +86,7 @@ struct obstack * _marpa_obs_begin ( int size, int alignment) struct obstack_chunk *chunk; /* points to new chunk */ struct obstack *h; /* points to new obstack */ const int minimum_chunk_size = sizeof(struct obstack_chunk); - /* Just enough room for the obstack header */ + /* Just enough room for the chunk and obstack headers */ if (alignment == 0) alignment = DEFAULT_ALIGNMENT;