Lines Matching refs:code
45 An obstack is represented by a data structure of type @code{struct
53 You can declare variables of type @code{struct obstack} and use them as
60 obstack to use. You do this with a pointer of type @code{struct obstack
65 @dfn{chunks}. The @code{struct obstack} structure points to a chain of
72 get a chunk. Usually you supply a function which uses @code{malloc}
88 Also, if the source file uses the macro @code{obstack_init}, it must
90 obstack library. One, @code{obstack_chunk_alloc}, is used to allocate
92 @code{obstack_chunk_free}, is used to return chunks when the objects in
96 Usually these are defined to use @code{malloc} via the intermediary
97 @code{xmalloc} (@pxref{Unconstrained Allocation, , , libc, The GNU C Library Reference Manual}). T…
106 Though the memory you get using obstacks really comes from @code{malloc},
107 using obstacks is faster because @code{malloc} is called less often, for
110 At run time, before the program can use a @code{struct obstack} object
112 @code{obstack_init}.
118 function calls the obstack's @code{obstack_chunk_alloc} function. If
120 @code{obstack_alloc_failed_handler} is called. The @code{obstack_init}
148 @code{obstack} uses when @code{obstack_chunk_alloc} fails to allocate
150 You should supply a function that either calls @code{exit}
151 (@pxref{Program Termination, , , libc, The GNU C Library Reference Manual}) or @code{longjmp} (@pxr…
167 @code{obstack_alloc}, which is invoked almost like @code{malloc}.
174 to allocate the block in; it is the address of the @code{struct obstack}
178 This function calls the obstack's @code{obstack_chunk_alloc} function if
180 @code{obstack_alloc_failed_handler} if allocation of memory by
181 @code{obstack_chunk_alloc} failed.
185 in a specific obstack, which is in the variable @code{string_obstack}:
201 @code{obstack_copy}, declared like this:
208 @code{obstack_alloc_failed_handler} if allocation of memory by
209 @code{obstack_chunk_alloc} failed.
215 Like @code{obstack_copy}, but appends an extra byte containing a null
219 The @code{obstack_copy0} function is convenient for copying a sequence
232 Contrast this with the previous example of @code{savestring} using
233 @code{malloc} (@pxref{Basic Allocation, , , libc, The GNU C Library Reference Manual}).
240 @code{obstack_free}. Since the obstack is a stack of objects, freeing
255 valid for further allocation, call @code{obstack_free} with the address
290 you will find that @code{get_obstack} may be called several times.
291 If you use @code{*obstack_list_ptr++} as the obstack pointer argument,
338 finished. This is done with the function @code{obstack_finish}.
352 @code{obstack_blank}, which adds space without initializing it.
358 To add a block of initialized space, use @code{obstack_grow}, which is
359 the growing-object analogue of @code{obstack_copy}. It adds @var{size}
367 This is the growing-object analogue of @code{obstack_copy0}. It adds
375 To add one character at a time, use the function @code{obstack_1grow}.
383 @code{obstack_ptr_grow}. It adds @code{sizeof (void *)} bytes
390 A single value of type @code{int} can be added by using the
391 @code{obstack_int_grow} function. It adds @code{sizeof (int)} bytes to
399 @code{obstack_finish} to close it off and return its final address.
405 @code{obstack_alloc} (@pxref{Allocation in an Obstack}).
411 before finishing the object with the function @code{obstack_object_size},
419 After it is finished, @code{obstack_object_size} will return zero.
433 You can use @code{obstack_blank} with a negative size argument to make
454 The function @code{obstack_room} returns the amount of room available
471 The function @code{obstack_1grow_fast} adds one byte containing the
478 The function @code{obstack_ptr_grow_fast} adds @code{sizeof (void *)}
486 The function @code{obstack_int_grow_fast} adds @code{sizeof (int)} bytes
494 The function @code{obstack_blank_fast} adds @var{size} bytes to the
498 When you check for space using @code{obstack_room} and there is not
505 sufficient space using @code{obstack_room}. Once the object is copied
567 growing object. If no object is growing, @code{obstack_next_free}
568 returns the same value as @code{obstack_base}.
591 @code{obstack_alignment_mask}, whose function prototype looks like
604 The expansion of the macro @code{obstack_alignment_mask} is an lvalue,
618 alignment mask take effect immediately by calling @code{obstack_finish}.
635 @code{obstack_chunk_alloc}, which you must define. When a chunk is no
637 library frees the chunk by calling @code{obstack_chunk_free}, which you
641 source file that uses @code{obstack_init} (@pxref{Creating Obstacks}).
650 arguments will not work! It is necessary that @code{obstack_chunk_alloc}
651 or @code{obstack_chunk_free}, alone, expand into a function name if it is
654 If you allocate chunks with @code{malloc}, the chunk size should be a
682 takes the address of an obstack (@code{struct obstack *}) as its first
685 @table @code