2.3.1.11 Summary of Obstack Macros

Here is a summary of all the macros associated with obstacks. Each takes the address of an obstack (struct obstack *) as its first argument.

int obstack_init (struct obstack *obstack-ptr)

Initialize use of an obstack. See Creating Obstacks.

int obstack_begin (struct obstack *obstack-ptr, size_t chunk_size)

Initialize use of an obstack, with an initial chunk of chunk_size bytes.

int obstack_specify_allocation (struct obstack *obstack-ptr, size_t chunk_size, size_t alignment, void *(*chunkfun) (size_t), void (*freefun) (void *))

Initialize use of an obstack, specifying intial chunk size, chunk alignment, and memory allocation functions.

int obstack_specify_allocation_with_arg (struct obstack *obstack-ptr, size_t chunk_size, size_t alignment, void *(*chunkfun) (void *, size_t), void (*freefun) (void *, void *), void *arg)

Like obstack_specify_allocation, but specifying memory allocation functions that take an extra first argument, arg.

void *obstack_alloc (struct obstack *obstack-ptr, size_t size)

Allocate an object of size uninitialized bytes. See Allocation in an Obstack.

void *obstack_copy (struct obstack *obstack-ptr, void *address, size_t size)

Allocate an object of size bytes, with contents copied from address. See Allocation in an Obstack.

void *obstack_copy0 (struct obstack *obstack-ptr, void *address, size_t size)

Allocate an object of size+1 bytes, with size of them copied from address, followed by a null character at the end. See Allocation in an Obstack.

void obstack_free (struct obstack *obstack-ptr, void *object)

Free object (and everything allocated in the specified obstack more recently than object). See Freeing Objects in an Obstack.

void obstack_blank (struct obstack *obstack-ptr, size_t size)

Add size uninitialized bytes to a growing object. See Growing Objects.

void obstack_grow (struct obstack *obstack-ptr, void *address, size_t size)

Add size bytes, copied from address, to a growing object. See Growing Objects.

void obstack_grow0 (struct obstack *obstack-ptr, void *address, size_t size)

Add size bytes, copied from address, to a growing object, and then add another byte containing a null character. See Growing Objects.

void obstack_1grow (struct obstack *obstack-ptr, char data-char)

Add one byte containing data-char to a growing object. See Growing Objects.

void *obstack_finish (struct obstack *obstack-ptr)

Finalize the object that is growing and return its permanent address. See Growing Objects.

size_t obstack_object_size (struct obstack *obstack-ptr)

Get the current size of the currently growing object. See Growing Objects.

void obstack_blank_fast (struct obstack *obstack-ptr, size_t size)

Add size uninitialized bytes to a growing object without checking that there is enough room. See Extra Fast Growing Objects.

void obstack_1grow_fast (struct obstack *obstack-ptr, char data-char)

Add one byte containing data-char to a growing object without checking that there is enough room. See Extra Fast Growing Objects.

size_t obstack_room (struct obstack *obstack-ptr)

Get the amount of room now available for growing the current object. See Extra Fast Growing Objects.

size_t obstack_alignment_mask (struct obstack *obstack-ptr)

The mask used for aligning the beginning of an object. This is an lvalue. See Alignment of Data in Obstacks.

size_t obstack_chunk_size (struct obstack *obstack-ptr)

The size for allocating chunks. This is an lvalue. See Obstack Chunks.

void *obstack_base (struct obstack *obstack-ptr)

Tentative starting address of the currently growing object. See Status of an Obstack.

void *obstack_next_free (struct obstack *obstack-ptr)

Address just after the end of the currently growing object. See Status of an Obstack.