This section covers how ordinary programs manage storage for their data,
including the famous @code{malloc} function and some fancier facilities
-special @theglibc{} and GNU Compiler.
+special to @theglibc{} and GNU Compiler.
@menu
* Memory Allocation and C:: How to get different kinds of allocation in C.
There was insufficient memory available to satisfy the request.
@item EINVAL
-@var{alignment} is not a power of two.
+@var{boundary} is not a power of two.
@end table
@c _int_memalign dup @acsfd @acsmem
@c mutex_unlock dup @aculock
Using @code{valloc} is like using @code{memalign} and passing the page size
-as the value of the second argument. It is implemented like this:
+as the value of the first argument. It is implemented like this:
@smallexample
void *
A complicated task when programming with languages which do not use
garbage collected dynamic memory allocation is to find memory leaks.
-Long running programs must assure that dynamically allocated objects are
+Long running programs must ensure that dynamically allocated objects are
freed at the end of their lifetime. If this does not happen the system
runs out of memory, sooner or later.
@}
@end example
-This is all what is needed if you want to trace the calls during the
+This is all that is needed if you want to trace the calls during the
whole runtime of the program. Alternatively you can stop the tracing at
any time with a call to @code{muntrace}. It is even possible to restart
the tracing again with a new call to @code{mtrace}. But this can cause
functions, also libraries (including the C library itself) use these
functions.
-This last point is also why it is no good idea to call @code{muntrace}
-before the program terminated. The libraries are informed about the
+This last point is also why it is not a good idea to call @code{muntrace}
+before the program terminates. The libraries are informed about the
termination of the program only after the program returns from
@code{main} or calls @code{exit} and so cannot free the memory they use
before this time.
If @var{object} is a null pointer, everything allocated in the obstack
is freed. Otherwise, @var{object} must be the address of an object
allocated in the obstack. Then @var{object} is freed, along with
-everything allocated in @var{obstack} since @var{object}.
+everything allocated in @var{obstack-ptr} since @var{object}.
@end deftypefun
Note that if @var{object} is a null pointer, the result is an
@safety{@prelim{}@mtsafe{@mtsrace{:obstack-ptr}}@assafe{}@acsafe{}}
This returns the number of bytes that can be added safely to the current
growing object (or to an object about to be started) in obstack
-@var{obstack} using the fast growth functions.
+@var{obstack-ptr} using the fast growth functions.
@end deftypefun
While you know there is room, you can use these fast growth functions
@item
Since @code{alloca} does not have separate pools for different sizes of
-block, space used for any size block can be reused for any other size.
+blocks, space used for any size block can be reused for any other size.
@code{alloca} does not cause memory fragmentation.
@item
last byte in the segment plus 1.
The function has no effect if @var{addr} is lower than the low end of
-the data segment. (This is considered success, by the way).
+the data segment. (This is considered success, by the way.)
The function fails if it would cause the data segment to overlap another
segment or exceed the process' data storage limit (@pxref{Limits on
@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
@code{munlockall} unlocks every page in the calling process' virtual
-address space and turn off @code{MCL_FUTURE} future locking mode.
+address space and turns off @code{MCL_FUTURE} future locking mode.
The return value is zero if the function succeeds. Otherwise, it is
@code{-1} and @code{errno} is set accordingly. The only way this