Article View: comp.std.c
Article #431Shrinking with realloc
From: signup
Date: Thu, 10 Aug 1989 01:58
Date: Thu, 10 Aug 1989 01:58
9 lines
685 bytes
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!signupShow 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