obstack.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. /* obstack.h - object stack macros
  2. Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998,
  3. 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
  4. Free Software Foundation, Inc.
  5. NOTE: The canonical source of this file is maintained with the GNU C Library.
  6. Bugs can be reported to bug-glibc@gnu.org.
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2, or (at your option) any
  10. later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301,
  18. USA. */
  19. /* Summary:
  20. All the apparent functions defined here are macros. The idea
  21. is that you would use these pre-tested macros to solve a
  22. very specific set of problems, and they would run fast.
  23. Caution: no side-effects in arguments please!! They may be
  24. evaluated MANY times!!
  25. These macros operate a stack of objects. Each object starts life
  26. small, and may grow to maturity. (Consider building a word syllable
  27. by syllable.) An object can move while it is growing. Once it has
  28. been "finished" it never changes address again. So the "top of the
  29. stack" is typically an immature growing object, while the rest of the
  30. stack is of mature, fixed size and fixed address objects.
  31. These routines grab large chunks of memory, using a function you
  32. supply, called `obstack_chunk_alloc'. On occasion, they free chunks,
  33. by calling `obstack_chunk_free'. You must define them and declare
  34. them before using any obstack macros.
  35. Each independent stack is represented by a `struct obstack'.
  36. Each of the obstack macros expects a pointer to such a structure
  37. as the first argument.
  38. One motivation for this package is the problem of growing char strings
  39. in symbol tables. Unless you are "fascist pig with a read-only mind"
  40. --Gosper's immortal quote from HAKMEM item 154, out of context--you
  41. would not like to put any arbitrary upper limit on the length of your
  42. symbols.
  43. In practice this often means you will build many short symbols and a
  44. few long symbols. At the time you are reading a symbol you don't know
  45. how long it is. One traditional method is to read a symbol into a
  46. buffer, realloc()ating the buffer every time you try to read a symbol
  47. that is longer than the buffer. This is beaut, but you still will
  48. want to copy the symbol from the buffer to a more permanent
  49. symbol-table entry say about half the time.
  50. With obstacks, you can work differently. Use one obstack for all symbol
  51. names. As you read a symbol, grow the name in the obstack gradually.
  52. When the name is complete, finalize it. Then, if the symbol exists already,
  53. free the newly read name.
  54. The way we do this is to take a large chunk, allocating memory from
  55. low addresses. When you want to build a symbol in the chunk you just
  56. add chars above the current "high water mark" in the chunk. When you
  57. have finished adding chars, because you got to the end of the symbol,
  58. you know how long the chars are, and you can create a new object.
  59. Mostly the chars will not burst over the highest address of the chunk,
  60. because you would typically expect a chunk to be (say) 100 times as
  61. long as an average object.
  62. In case that isn't clear, when we have enough chars to make up
  63. the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed)
  64. so we just point to it where it lies. No moving of chars is
  65. needed and this is the second win: potentially long strings need
  66. never be explicitly shuffled. Once an object is formed, it does not
  67. change its address during its lifetime.
  68. When the chars burst over a chunk boundary, we allocate a larger
  69. chunk, and then copy the partly formed object from the end of the old
  70. chunk to the beginning of the new larger chunk. We then carry on
  71. accreting characters to the end of the object as we normally would.
  72. A special macro is provided to add a single char at a time to a
  73. growing object. This allows the use of register variables, which
  74. break the ordinary 'growth' macro.
  75. Summary:
  76. We allocate large chunks.
  77. We carve out one object at a time from the current chunk.
  78. Once carved, an object never moves.
  79. We are free to append data of any size to the currently
  80. growing object.
  81. Exactly one object is growing in an obstack at any one time.
  82. You can run one obstack per control block.
  83. You may have as many control blocks as you dare.
  84. Because of the way we do it, you can `unwind' an obstack
  85. back to a previous state. (You may remove objects much
  86. as you would with a stack.)
  87. */
  88. /* Don't do the contents of this file more than once. */
  89. #ifndef _OBSTACK_H
  90. #define _OBSTACK_H 1
  91. #ifdef __cplusplus
  92. extern "C" {
  93. #endif
  94. /* We use subtraction of (char *) 0 instead of casting to int
  95. because on word-addressable machines a simple cast to int
  96. may ignore the byte-within-word field of the pointer. */
  97. #ifndef __PTR_TO_INT
  98. # define __PTR_TO_INT(P) ((P) - (char *) 0)
  99. #endif
  100. #ifndef __INT_TO_PTR
  101. # define __INT_TO_PTR(P) ((P) + (char *) 0)
  102. #endif
  103. /* We need the type of the resulting object. If __PTRDIFF_TYPE__ is
  104. defined, as with GNU C, use that; that way we don't pollute the
  105. namespace with <stddef.h>'s symbols. Otherwise, if <stddef.h> is
  106. available, include it and use ptrdiff_t. In traditional C, long is
  107. the best that we can do. */
  108. #ifdef __PTRDIFF_TYPE__
  109. # define PTR_INT_TYPE __PTRDIFF_TYPE__
  110. #else
  111. # ifdef HAVE_STDDEF_H
  112. # include <stddef.h>
  113. # define PTR_INT_TYPE ptrdiff_t
  114. # else
  115. # define PTR_INT_TYPE long
  116. # endif
  117. #endif
  118. #if defined _LIBC || defined HAVE_STRING_H
  119. # include <string.h>
  120. # define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
  121. #else
  122. # ifdef memcpy
  123. # define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N))
  124. # else
  125. # define _obstack_memcpy(To, From, N) bcopy ((char *)(From), (To), (N))
  126. # endif
  127. #endif
  128. struct _obstack_chunk /* Lives at front of each chunk. */
  129. {
  130. char *limit; /* 1 past end of this chunk */
  131. struct _obstack_chunk *prev; /* address of prior chunk or NULL */
  132. char contents[4]; /* objects begin here */
  133. };
  134. struct obstack /* control current object in current chunk */
  135. {
  136. long chunk_size; /* preferred size to allocate chunks in */
  137. struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */
  138. char *object_base; /* address of object we are building */
  139. char *next_free; /* where to add next char to current object */
  140. char *chunk_limit; /* address of char after current chunk */
  141. PTR_INT_TYPE temp; /* Temporary for some macros. */
  142. int alignment_mask; /* Mask of alignment for each object. */
  143. /* These prototypes vary based on `use_extra_arg', and we use
  144. casts to the prototypeless function type in all assignments,
  145. but having prototypes here quiets -Wstrict-prototypes. */
  146. struct _obstack_chunk *(*chunkfun) (void *, long);
  147. void (*freefun) (void *, struct _obstack_chunk *);
  148. void *extra_arg; /* first arg for chunk alloc/dealloc funcs */
  149. unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
  150. unsigned maybe_empty_object:1;/* There is a possibility that the current
  151. chunk contains a zero-length object. This
  152. prevents freeing the chunk if we allocate
  153. a bigger chunk to replace it. */
  154. unsigned alloc_failed:1; /* No longer used, as we now call the failed
  155. handler on error, but retained for binary
  156. compatibility. */
  157. };
  158. /* Declare the external functions we use; they are in obstack.c. */
  159. extern void _obstack_newchunk (struct obstack *, int);
  160. extern void _obstack_free (struct obstack *, void *);
  161. extern int _obstack_begin (struct obstack *, int, int,
  162. void *(*) (long), void (*) (void *));
  163. extern int _obstack_begin_1 (struct obstack *, int, int,
  164. void *(*) (void *, long),
  165. void (*) (void *, void *), void *);
  166. extern int _obstack_memory_used (struct obstack *);
  167. /* Do the function-declarations after the structs
  168. but before defining the macros. */
  169. void obstack_init (struct obstack *obstack);
  170. void * obstack_alloc (struct obstack *obstack, int size);
  171. void * obstack_copy (struct obstack *obstack, void *address, int size);
  172. void * obstack_copy0 (struct obstack *obstack, void *address, int size);
  173. void obstack_free (struct obstack *obstack, void *block);
  174. void obstack_blank (struct obstack *obstack, int size);
  175. void obstack_grow (struct obstack *obstack, void *data, int size);
  176. void obstack_grow0 (struct obstack *obstack, void *data, int size);
  177. void obstack_1grow (struct obstack *obstack, int data_char);
  178. void obstack_ptr_grow (struct obstack *obstack, void *data);
  179. void obstack_int_grow (struct obstack *obstack, int data);
  180. void * obstack_finish (struct obstack *obstack);
  181. int obstack_object_size (struct obstack *obstack);
  182. int obstack_room (struct obstack *obstack);
  183. void obstack_make_room (struct obstack *obstack, int size);
  184. void obstack_1grow_fast (struct obstack *obstack, int data_char);
  185. void obstack_ptr_grow_fast (struct obstack *obstack, void *data);
  186. void obstack_int_grow_fast (struct obstack *obstack, int data);
  187. void obstack_blank_fast (struct obstack *obstack, int size);
  188. void * obstack_base (struct obstack *obstack);
  189. void * obstack_next_free (struct obstack *obstack);
  190. int obstack_alignment_mask (struct obstack *obstack);
  191. int obstack_chunk_size (struct obstack *obstack);
  192. int obstack_memory_used (struct obstack *obstack);
  193. /* Error handler called when `obstack_chunk_alloc' failed to allocate
  194. more memory. This can be set to a user defined function. The
  195. default action is to print a message and abort. */
  196. extern void (*obstack_alloc_failed_handler) (void);
  197. /* Exit value used when `print_and_abort' is used. */
  198. extern int obstack_exit_failure;
  199. /* Pointer to beginning of object being allocated or to be allocated next.
  200. Note that this might not be the final address of the object
  201. because a new chunk might be needed to hold the final size. */
  202. #define obstack_base(h) ((h)->object_base)
  203. /* Size for allocating ordinary chunks. */
  204. #define obstack_chunk_size(h) ((h)->chunk_size)
  205. /* Pointer to next byte not yet allocated in current chunk. */
  206. #define obstack_next_free(h) ((h)->next_free)
  207. /* Mask specifying low bits that should be clear in address of an object. */
  208. #define obstack_alignment_mask(h) ((h)->alignment_mask)
  209. /* To prevent prototype warnings provide complete argument list in
  210. standard C version. */
  211. # define obstack_init(h) \
  212. _obstack_begin ((h), 0, 0, \
  213. (void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
  214. # define obstack_begin(h, size) \
  215. _obstack_begin ((h), (size), 0, \
  216. (void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
  217. # define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
  218. _obstack_begin ((h), (size), (alignment), \
  219. (void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun))
  220. # define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
  221. _obstack_begin_1 ((h), (size), (alignment), \
  222. (void *(*) (void *, long)) (chunkfun), \
  223. (void (*) (void *, void *)) (freefun), (arg))
  224. # define obstack_chunkfun(h, newchunkfun) \
  225. ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun))
  226. # define obstack_freefun(h, newfreefun) \
  227. ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
  228. #define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar))
  229. #define obstack_blank_fast(h,n) ((h)->next_free += (n))
  230. #define obstack_memory_used(h) _obstack_memory_used (h)
  231. #if defined __GNUC__ && defined __STDC__ && __STDC__
  232. /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
  233. does not implement __extension__. But that compiler doesn't define
  234. __GNUC_MINOR__. */
  235. # if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
  236. # define __extension__
  237. # endif
  238. /* For GNU C, if not -traditional,
  239. we can define these macros to compute all args only once
  240. without using a global variable.
  241. Also, we can avoid using the `temp' slot, to make faster code. */
  242. # define obstack_object_size(OBSTACK) \
  243. __extension__ \
  244. ({ struct obstack *__o = (OBSTACK); \
  245. (unsigned) (__o->next_free - __o->object_base); })
  246. # define obstack_room(OBSTACK) \
  247. __extension__ \
  248. ({ struct obstack *__o = (OBSTACK); \
  249. (unsigned) (__o->chunk_limit - __o->next_free); })
  250. # define obstack_make_room(OBSTACK,length) \
  251. __extension__ \
  252. ({ struct obstack *__o = (OBSTACK); \
  253. int __len = (length); \
  254. if (__o->chunk_limit - __o->next_free < __len) \
  255. _obstack_newchunk (__o, __len); \
  256. (void) 0; })
  257. # define obstack_empty_p(OBSTACK) \
  258. __extension__ \
  259. ({ struct obstack *__o = (OBSTACK); \
  260. (__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
  261. # define obstack_grow(OBSTACK,where,length) \
  262. __extension__ \
  263. ({ struct obstack *__o = (OBSTACK); \
  264. int __len = (length); \
  265. if (__o->next_free + __len > __o->chunk_limit) \
  266. _obstack_newchunk (__o, __len); \
  267. _obstack_memcpy (__o->next_free, (where), __len); \
  268. __o->next_free += __len; \
  269. (void) 0; })
  270. # define obstack_grow0(OBSTACK,where,length) \
  271. __extension__ \
  272. ({ struct obstack *__o = (OBSTACK); \
  273. int __len = (length); \
  274. if (__o->next_free + __len + 1 > __o->chunk_limit) \
  275. _obstack_newchunk (__o, __len + 1); \
  276. _obstack_memcpy (__o->next_free, (where), __len); \
  277. __o->next_free += __len; \
  278. *(__o->next_free)++ = 0; \
  279. (void) 0; })
  280. # define obstack_1grow(OBSTACK,datum) \
  281. __extension__ \
  282. ({ struct obstack *__o = (OBSTACK); \
  283. if (__o->next_free + 1 > __o->chunk_limit) \
  284. _obstack_newchunk (__o, 1); \
  285. obstack_1grow_fast (__o, datum); \
  286. (void) 0; })
  287. /* These assume that the obstack alignment is good enough for pointers or ints,
  288. and that the data added so far to the current object
  289. shares that much alignment. */
  290. # define obstack_ptr_grow(OBSTACK,datum) \
  291. __extension__ \
  292. ({ struct obstack *__o = (OBSTACK); \
  293. if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
  294. _obstack_newchunk (__o, sizeof (void *)); \
  295. obstack_ptr_grow_fast (__o, datum); })
  296. # define obstack_int_grow(OBSTACK,datum) \
  297. __extension__ \
  298. ({ struct obstack *__o = (OBSTACK); \
  299. if (__o->next_free + sizeof (int) > __o->chunk_limit) \
  300. _obstack_newchunk (__o, sizeof (int)); \
  301. obstack_int_grow_fast (__o, datum); })
  302. # define obstack_ptr_grow_fast(OBSTACK,aptr) \
  303. __extension__ \
  304. ({ struct obstack *__o1 = (OBSTACK); \
  305. *(const void **) __o1->next_free = (aptr); \
  306. __o1->next_free += sizeof (const void *); \
  307. (void) 0; })
  308. # define obstack_int_grow_fast(OBSTACK,aint) \
  309. __extension__ \
  310. ({ struct obstack *__o1 = (OBSTACK); \
  311. *(int *) __o1->next_free = (aint); \
  312. __o1->next_free += sizeof (int); \
  313. (void) 0; })
  314. # define obstack_blank(OBSTACK,length) \
  315. __extension__ \
  316. ({ struct obstack *__o = (OBSTACK); \
  317. int __len = (length); \
  318. if (__o->chunk_limit - __o->next_free < __len) \
  319. _obstack_newchunk (__o, __len); \
  320. obstack_blank_fast (__o, __len); \
  321. (void) 0; })
  322. # define obstack_alloc(OBSTACK,length) \
  323. __extension__ \
  324. ({ struct obstack *__h = (OBSTACK); \
  325. obstack_blank (__h, (length)); \
  326. obstack_finish (__h); })
  327. # define obstack_copy(OBSTACK,where,length) \
  328. __extension__ \
  329. ({ struct obstack *__h = (OBSTACK); \
  330. obstack_grow (__h, (where), (length)); \
  331. obstack_finish (__h); })
  332. # define obstack_copy0(OBSTACK,where,length) \
  333. __extension__ \
  334. ({ struct obstack *__h = (OBSTACK); \
  335. obstack_grow0 (__h, (where), (length)); \
  336. obstack_finish (__h); })
  337. /* The local variable is named __o1 to avoid a name conflict
  338. when obstack_blank is called. */
  339. # define obstack_finish(OBSTACK) \
  340. __extension__ \
  341. ({ struct obstack *__o1 = (OBSTACK); \
  342. void *value; \
  343. value = (void *) __o1->object_base; \
  344. if (__o1->next_free == value) \
  345. __o1->maybe_empty_object = 1; \
  346. __o1->next_free \
  347. = __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
  348. & ~ (__o1->alignment_mask)); \
  349. if (__o1->next_free - (char *)__o1->chunk \
  350. > __o1->chunk_limit - (char *)__o1->chunk) \
  351. __o1->next_free = __o1->chunk_limit; \
  352. __o1->object_base = __o1->next_free; \
  353. value; })
  354. # define obstack_free(OBSTACK, OBJ) \
  355. __extension__ \
  356. ({ struct obstack *__o = (OBSTACK); \
  357. void *__obj = (void *) (OBJ); \
  358. if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
  359. __o->next_free = __o->object_base = (char *) __obj; \
  360. else (obstack_free) (__o, __obj); })
  361. #else /* not __GNUC__ or not __STDC__ */
  362. # define obstack_object_size(h) \
  363. (unsigned) ((h)->next_free - (h)->object_base)
  364. # define obstack_room(h) \
  365. (unsigned) ((h)->chunk_limit - (h)->next_free)
  366. # define obstack_empty_p(h) \
  367. ((h)->chunk->prev == 0 && (h)->next_free - (h)->chunk->contents == 0)
  368. /* Note that the call to _obstack_newchunk is enclosed in (..., 0)
  369. so that we can avoid having void expressions
  370. in the arms of the conditional expression.
  371. Casting the third operand to void was tried before,
  372. but some compilers won't accept it. */
  373. # define obstack_make_room(h,length) \
  374. ( (h)->temp = (length), \
  375. (((h)->next_free + (h)->temp > (h)->chunk_limit) \
  376. ? (_obstack_newchunk ((h), (h)->temp), 0) : 0))
  377. # define obstack_grow(h,where,length) \
  378. ( (h)->temp = (length), \
  379. (((h)->next_free + (h)->temp > (h)->chunk_limit) \
  380. ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
  381. _obstack_memcpy ((h)->next_free, (where), (h)->temp), \
  382. (h)->next_free += (h)->temp)
  383. # define obstack_grow0(h,where,length) \
  384. ( (h)->temp = (length), \
  385. (((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
  386. ? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
  387. _obstack_memcpy ((h)->next_free, (where), (h)->temp), \
  388. (h)->next_free += (h)->temp, \
  389. *((h)->next_free)++ = 0)
  390. # define obstack_1grow(h,datum) \
  391. ( (((h)->next_free + 1 > (h)->chunk_limit) \
  392. ? (_obstack_newchunk ((h), 1), 0) : 0), \
  393. obstack_1grow_fast (h, datum))
  394. # define obstack_ptr_grow(h,datum) \
  395. ( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
  396. ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
  397. obstack_ptr_grow_fast (h, datum))
  398. # define obstack_int_grow(h,datum) \
  399. ( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
  400. ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
  401. obstack_int_grow_fast (h, datum))
  402. # define obstack_ptr_grow_fast(h,aptr) \
  403. (((const void **) ((h)->next_free += sizeof (void *)))[-1] = (aptr))
  404. # define obstack_int_grow_fast(h,aint) \
  405. (((int *) ((h)->next_free += sizeof (int)))[-1] = (aptr))
  406. # define obstack_blank(h,length) \
  407. ( (h)->temp = (length), \
  408. (((h)->chunk_limit - (h)->next_free < (h)->temp) \
  409. ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
  410. obstack_blank_fast (h, (h)->temp))
  411. # define obstack_alloc(h,length) \
  412. (obstack_blank ((h), (length)), obstack_finish ((h)))
  413. # define obstack_copy(h,where,length) \
  414. (obstack_grow ((h), (where), (length)), obstack_finish ((h)))
  415. # define obstack_copy0(h,where,length) \
  416. (obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
  417. # define obstack_finish(h) \
  418. ( ((h)->next_free == (h)->object_base \
  419. ? (((h)->maybe_empty_object = 1), 0) \
  420. : 0), \
  421. (h)->temp = __PTR_TO_INT ((h)->object_base), \
  422. (h)->next_free \
  423. = __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \
  424. & ~ ((h)->alignment_mask)), \
  425. (((h)->next_free - (char *) (h)->chunk \
  426. > (h)->chunk_limit - (char *) (h)->chunk) \
  427. ? ((h)->next_free = (h)->chunk_limit) : 0), \
  428. (h)->object_base = (h)->next_free, \
  429. (void *) __INT_TO_PTR ((h)->temp))
  430. # define obstack_free(h,obj) \
  431. ( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
  432. (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
  433. ? (((h)->next_free = (h)->object_base \
  434. = (h)->temp + (char *) (h)->chunk), 0) \
  435. : ((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0)))
  436. #endif /* not __GNUC__ or not __STDC__ */
  437. #ifdef __cplusplus
  438. } /* C++ */
  439. #endif
  440. #endif /* obstack.h */