/* obstack.c - subroutines used implicitly by object stack macros
- Copyright (C) 1988,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
+ Copyright (C) 1988-1994,96,97,98,99 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
/* The functions allocating more room by calling `obstack_chunk_alloc'
jump to the handler pointed to by `obstack_alloc_failed_handler'.
- This variable by default points to the internal function
+ This can be set to a user defined function which should either
+ abort gracefully or use longjump - but shouldn't return. This
+ variable by default points to the internal function
`print_and_abort'. */
#if defined (__STDC__) && __STDC__
static void print_and_abort (void);
CHUNKFUN is the function to use to allocate chunks,
and FREEFUN the function to free them.
- Return nonzero if successful, zero if out of memory.
- To recover from an out of memory error,
- free up some memory, then call this again. */
+ Return nonzero if successful, calls obstack_alloc_failed_handler if
+ allocation fails. */
int
_obstack_begin (h, size, alignment, chunkfun, freefun)
static void
print_and_abort ()
{
- fputs (_("memory exhausted\n"), stderr);
+ fputs (_("memory exhausted"), stderr);
+ fputc ('\n', stderr);
exit (obstack_exit_failure);
}
\f