]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Enhance comment about obstack_alloc_failed_handler usage.
authorUlrich Drepper <drepper@redhat.com>
Wed, 7 Oct 1998 10:47:39 +0000 (10:47 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 7 Oct 1998 10:47:39 +0000 (10:47 +0000)
malloc/obstack.c
malloc/obstack.h

index 731762f5a98d06beb0911546cad3224bac884edc..4895e48b192d3b5c6f081484acb40244bad5e238 100644 (file)
@@ -78,7 +78,9 @@ union fooround {long x; double d;};
 
 /* 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);
@@ -142,9 +144,8 @@ struct obstack *_obstack;
    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)
index e7ae6959e549adfd051ffe2b6b2aba98c18df20e..d89cbc94c92a894ab1a7bf8f4ff4a3524885cb12 100644 (file)
@@ -1,5 +1,5 @@
 /* obstack.h - object stack macros
-   Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
+   Copyright (C) 1988,89,90,91,92,93,94,96,97,98 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.
@@ -260,8 +260,9 @@ int obstack_memory_used (struct obstack *obstack);
    so we do not declare them.  */
 
 /* Error handler called when `obstack_chunk_alloc' failed to allocate
-   more memory.  This can be set to a user defined function.  The
-   default action is to print a message and abort.  */
+   more memory.  This can be set to a user defined function which
+   should either abort gracefully or use longjump - but shouldn't
+   return.  The default action is to print a message and abort.  */
 #if defined (__STDC__) && __STDC__
 extern void (*obstack_alloc_failed_handler) (void);
 #else