RE: [xml] Action of realloc

Date view Thread view Subject view Author view

From: Leo Davidson (leo@ox.compsoc.net)
Date: Wed Dec 06 2000 - 06:45:10 EST


My docs say realloc leaves the original memory block alone when it fails,
but returns NULL. (Perhaps this is what you meant anyway; if so, sorry.)

"realloc returns a void pointer to the reallocated (and possibly moved)
memory block. The return value is NULL if the size is zero and the buffer
argument is not NULL, or if there is not enough available memory to expand
the block to the given size. In the first case, the original block is freed.
In the second, the original block is unchanged."

(Not the clearest way it could be explained, of course.)

> -----Original Message-----
> From: xml-request@rufus.w3.org [mailto:xml-request@rufus.w3.org]On
> Behalf Of Bjorn Reese
> Sent: Tuesday, December 05 2000 20:21
> To: xml@rpmfind.net
> Subject: Re: [xml] Action of realloc
>
>
>
> JohnnyXia@acersoftech.com.cn wrote:
>
> > pOld = realloc( pOld, newsize );
>
> You are right. If realloc() fails, then the old memory block is
> lost. This behaviour is not restricted to individual platforms,
> but a general ANSI/ISO stdlib behaviour.
> ----
> Message from the list xml@rpmfind.net
> Archived at : http://xmlsoft.org/messages/
> to unsubscribe: echo "unsubscribe xml" | mail majordomo@rpmfind.net

----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Dec 06 2000 - 09:43:47 EST