Path: utzoo!attcan!uunet!cs.utexas.edu!sdd.hp.com!ucsd!usc!jarthur!bridge2!mips!sgi!yohn@tumult.asd.sgi.com From: yohn@tumult.asd.sgi.com (Mike Thompson) Newsgroups: comp.sys.sgi Subject: Re: Bus error DURING call to malloc() Summary: that's what realloc should do Keywords: help bus error malloc Message-ID: <62209@sgi.sgi.com> Date: 13 Jun 90 19:42:20 GMT References: <14525@thorin.cs.unc.edu> <62083@sgi.sgi.com> <75367@aerospace.AERO.ORG> Sender: yohn@tumult.asd.sgi.com Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 21 In article <75367@aerospace.AERO.ORG>, swed@aerospace.aero.org (Gregory D. Swedberg) writes: > > > Are you ever calling realloc? The IRIS does not seem to > implement it correctly, when reallocing to the a larger size it seems > to just return the original pointer rather than a pointer to a new > larger block. I have had to give up on realloc on the IRIS. Are you implying that realloc isn't returning a large enough buffer for your (new) request? The whole purpose of realloc is to avoid copying data around whenever possible. To that end, realloc will check to see if it can grow the current buffer to satisfy the request and just pass back the same (grown) buffer. If there isn't enough room to grow the current buffer, a new buffer will be allocated, the data copied, and the old buffer released. If you think that realloc is returning the same buffer and it hasn't grown the buffer adequately, please call the customer support hot line immediately with details. Mike Thompson