All pastes #400355 Raw Edit

Something

public text v1 · immutable
·published 2007-03-18 17:27 UTC
rendered paste body

/* These assume that the obstack alignment is good enough for pointers or ints,
   and that the data added so far to the current object
   shares that much alignment.  */

# define obstack_ptr_grow(OBSTACK,datum)                                \
__extension__                                                           \
({ struct obstack *__o = (OBSTACK);                                     \
   if (__o->next_free + sizeof (void *) > __o->chunk_limit)             \
     _obstack_newchunk (__o, sizeof (void *));                          \
   *((void **)__o->next_free)++ = ((void *)datum);                      \
   (void) 0; })

# define obstack_int_grow(OBSTACK,datum)                                \
__extension__                                                           \
({ struct obstack *__o = (OBSTACK);                                     \
   if (__o->next_free + sizeof (int) > __o->chunk_limit)                \
     _obstack_newchunk (__o, sizeof (int));                             \
   *((int *)__o->next_free)++ = ((int)datum);                           \
   (void) 0; })

# define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *
# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) ain