🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #431

Shrinking with realloc

#431
From: signup
Date: Thu, 10 Aug 1989 01:58
9 lines
685 bytes
If realloc is used to shrink a chunk of allocated storage, is it guaranteed
by the standard that the storage won't be moved?  I couldn't find any positive
or negative statement about the matter.

I.e., after
	char *p, *q;
	q = p = (char *) malloc(10);
	(void) realloc(p,5);
is it valid to dereference q?
Technical Details
Message-ID: <26328@shemp.CS.UCLA.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ucla-cs!signup

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ucla-cs!signup
From: signup@valhalla.cs.ucla.edu
Newsgroups: comp.std.c
Subject: Shrinking with realloc
Message-ID: <26328@shemp.CS.UCLA.EDU>
Date: 10 Aug 89 01:58:16 GMT
Sender: news@CS.UCLA.EDU
Reply-To: signup@CS.UCLA.EDU
Organization: UCLA Computer Science
Lines: 9