From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: NEW, DELETE and realloc() Date: Sat, 07 Mar 1998 15:38:06 -0500 Organization: Two pounds of chaos and a pinch of salt. Lines: 20 Message-ID: <3501B02E.1C36@cs.com> References: NNTP-Posting-Host: ppp233.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Gili wrote: > > Is it possible to use realloc() on memory allocated using NEW? Is > there a C++ equivilent? Also, is it possible to simply write my own > NEW operator? If so, what does GCC do, simply reroute the command to > malloc() and call that instead? There is no realloc() equivalent for memory allocated using new. It's simply not a part of the C++ language. As for overloading new, you can do that like any other operator. new probably does invoke malloc() internally, but it does more than just that - it also invokes constructors for any objects it creates. -- --------------------------------------------------------------------- | John M. Aldrich | "Autocracy is based on the assumption| | aka Fighteer I | that one man is wiser than a million | | mailto:fighteer AT cs DOT com | men. Let's play that over again, | | http://www.cs.com/fighteer | too. Who decides?" - Lazarus Long | ---------------------------------------------------------------------