View | Details | Raw Unified | Return to bug 5081
Collapse All | Expand All

(-)memory.texi (-3 / +4 lines)
Lines 445-463 free_chain (struct chain *chain) Link Here
445
@end smallexample
445
@end smallexample
446
446
447
Occasionally, @code{free} can actually return memory to the operating
447
Occasionally, @code{free} can actually return memory to the operating
448
system and make the process smaller.  Usually, all it can do is allow a
448
system and make the process smaller.  Usually, all it can do is allow a
449
later call to @code{malloc} to reuse the space.  In the meantime, the
449
later call to @code{malloc} to reuse the space.  In the meantime, the
450
space remains in your program as part of a free-list used internally by
450
space remains in your program as part of a free-list used internally by
451
@code{malloc}.
451
@code{malloc}.
452
452
453
There is no point in freeing blocks at the end of a program, because all
453
When the process terminates, all of the program's space is given back
454
of the program's space is given back to the system when the process
454
to the system. While this means it is not mandatory to free all blocks
455
terminates.
455
at the end of a program, it is usually considered best practice to do
456
so, as it makes life easier when using memory debugging tools.
456
457
457
@node Changing Block Size
458
@node Changing Block Size
458
@subsubsection Changing the Size of a Block
459
@subsubsection Changing the Size of a Block
459
@cindex changing the size of a block (@code{malloc})
460
@cindex changing the size of a block (@code{malloc})
460
461
461
Often you do not know for certain how big a block you will ultimately need
462
Often you do not know for certain how big a block you will ultimately need
462
at the time you must begin to use the block.  For example, the block might
463
at the time you must begin to use the block.  For example, the block might
463
be a buffer that you use to hold a line being read from a file; no matter
464
be a buffer that you use to hold a line being read from a file; no matter

Return to bug 5081