diff options
author | Roland McGrath <roland@gnu.org> | 1994-10-11 03:51:06 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1994-10-11 03:51:06 +0000 |
commit | db40350c790e18c154b4e99a82adca1f0ef82549 (patch) | |
tree | f14afdfe11a99839de170539f1441156558e5482 | |
parent | 36a7d72126b16db29f165a94ef96b8aa50a112d1 (diff) | |
download | glibc-db40350c790e18c154b4e99a82adca1f0ef82549.tar.gz glibc-db40350c790e18c154b4e99a82adca1f0ef82549.tar.xz glibc-db40350c790e18c154b4e99a82adca1f0ef82549.zip |
(Dynamic Allocation and C): Say global variables are like static.
(Preparing for Obstacks): Say obstack_chunk_{free,alloc} should be defined before using obstacks.
-rw-r--r-- | manual/memory.texi | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/manual/memory.texi b/manual/memory.texi index b473279031..73d3cf7c67 100644 --- a/manual/memory.texi +++ b/manual/memory.texi @@ -75,10 +75,10 @@ in C programs: @itemize @bullet @item -@dfn{Static allocation} is what happens when you declare a static -variable. Each static variable defines one block of space, of a fixed -size. The space is allocated once, when your program is started, and -is never freed. +@dfn{Static allocation} is what happens when you declare a static or +global variable. Each static or global variable defines one block of +space, of a fixed size. The space is allocated once, when your program +is started, and is never freed. @item @dfn{Automatic allocation} happens when you declare an automatic @@ -815,10 +815,11 @@ must include the header file @file{obstack.h}, like this: @findex obstack_chunk_free Also, if the source file uses the macro @code{obstack_init}, it must declare or define two functions or macros that will be called by the -obstack library. One, @code{obstack_chunk_alloc}, is used to allocate the -chunks of memory into which objects are packed. The other, +obstack library. One, @code{obstack_chunk_alloc}, is used to allocate +the chunks of memory into which objects are packed. The other, @code{obstack_chunk_free}, is used to return chunks when the objects in -them are freed. +them are freed. These macros should appear before any use of obstacks +in the source file. Usually these are defined to use @code{malloc} via the intermediary @code{xmalloc} (@pxref{Unconstrained Allocation}). This is done with |