rreeaalllloocc() -- General Function (libc)

Reallocate dynamic memory
#iinncclluuddee <ssttddlliibb.hh>
cchhaarr *rreeaalllloocc(_p_t_r, _s_i_z_e)
cchhaarr *_p_t_r; uunnssiiggnneedd _s_i_z_e;

rreeaalllloocc() helps you  manage a program's arena.  It returns  a block of _s_i_z_e
bytes that  holds the contents of  the old block, up to  the smaller of the
old and new sizes.  rreeaalllloocc() tries  to return the same block, truncated or
extended; if _s_i_z_e is smaller than the size of the old block, rreeaalllloocc() will
return the same _p_t_r.

If _p_t_r is set to NULL, rreeaalllloocc() behaves like mmaalllloocc().

_E_x_a_m_p_l_e
For an example of this function, see the entry for ccaalllloocc().

_S_e_e _A_l_s_o
aallllooccaa(),  aarreennaa,  ccaalllloocc(),  ffrreeee(),  lliibbcc, mmaalllloocc(),  mmeemmookk(),  sseettbbuuff(),
ssttddlliibb.hh
ANSI Standard, section 7.10.3.4
POSIX Standard, section 8.1

_D_i_a_g_n_o_s_t_i_c_s
rreeaalllloocc() returns  NULL if insufficient  memory is available.   It prints a
message  and  calls  aabboorrtt()  if  it  discovers that  the  arena  has  been
corrupted,  which  most often  occurs  by  storing past  the  bounds of  an
allocated block.   rreeaalllloocc() behaves  unpredictably if handed  an incorrect
_p_t_r.
