<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE> {The S-lang C Library Reference}: SLrealloc</TITLE>
<LINK HREF="cref-98.html" REL=next>
<LINK HREF="cref-96.html" REL=previous>
<LINK HREF="cref.html#toc97" REL=contents>
</HEAD>
<BODY>
<A HREF="cref-98.html">Next</A>
<A HREF="cref-96.html">Previous</A>
<A HREF="cref.html#toc97">Contents</A>
<HR>
<H2><A NAME="SLrealloc"></A> <A NAME="s97">97. <B>SLrealloc</B></A></H2>

<P>
<DL>
<DT><B> Synopsis </B><DD><P>Resize a dynamic memory block
<DT><B> Usage </B><DD><P><CODE>char *SLrealloc (char *ptr, unsigned int new_size)</CODE>
<DT><B> Description </B><DD><P>The <CODE>SLrealloc</CODE> uses the <CODE>realloc</CODE> function to resize the
memory block specified by <CODE>ptr</CODE> to the new size <CODE>new_size</CODE>.
If <CODE>ptr</CODE> is <CODE>NULL</CODE>, the function call is equivalent to
<CODE>SLmalloc(new_size)</CODE>.  Similarly, if <CODE>new_size</CODE> is zero,
the function call is equivalent to <CODE>SLfree(ptr)</CODE>.  
<P>If the function fails, or if <CODE>new_size</CODE> is zero, <CODE>NULL</CODE> is
returned.  Otherwise a pointer is returned to the (possibly moved)
new block of memory.
<DT><B> See Also </B><DD><P><CODE>SLfree, SLmalloc, SLcalloc</CODE>
</DL>
<P>
<P>
<P>
<HR>
<A HREF="cref-98.html">Next</A>
<A HREF="cref-96.html">Previous</A>
<A HREF="cref.html#toc97">Contents</A>
</BODY>
</HTML>
