www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/24/16:30:25

From: XXguille AT XXiies DOT XXes (Guillermo Rodriguez Garcia)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Is realloced memory copied when necessary?
Date: Sun, 23 May 1999 09:46:00 GMT
Organization: Telefonica Transmision de Datos
Lines: 17
Message-ID: <374bcd79.1943655@noticias.iies.es>
References: <7i7sn2$uvt$2 AT news5 DOT svr DOT pol DOT co DOT uk>
NNTP-Posting-Host: iies226.iies.es
Mime-Version: 1.0
X-Newsreader: Forte Agent 1.5/32.451
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

El día Sun, 23 May 1999 04:29:46 +0100, "Andrew Davidson"
<andrew AT lemure DOT freeserve DOT co DOT uk> escribió:

>I need to know if, on making a call to realloc to expand the size of some
>memory I am using, will realloc copy the data from the original memory I
>pass to it if it returns a different pointer, or will I have to do that
>myself?

If realloc returns a different pointer it has already copied the
contents of the original memory block to the new location, up to the
lesser of the new and old sizes.

Regards,
GUILLE
----
Guillermo Rodriguez Garcia
XXguille AT XXiies DOT XXes (ya sabes :-)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019