From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: NEW, DELETE and realloc() Date: Thu, 05 Mar 1998 00:06:25 -0800 Organization: Alcyone Systems Lines: 28 Message-ID: <34FE5D01.4E69248C@alcyone.com> References: NNTP-Posting-Host: charmaine.alcyone.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? No. If you want to use constructors and destructors, then use new/delete. If you want to allocate memory (only, no constructors or destructors), and possibly resize blocks, use malloc/realloc/free. > Also, is it possible to simply write my own > NEW operator? Yes; get a good reference book on C++ for information on this. > If so, what does GCC do, simply reroute the command to > malloc() and call that instead? What gcc does or does not do cannot be depended upon beyond what is indicated in the C++ draft specifications. -- Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com Alcyone Systems / http://www.alcyone.com/max/ San Jose, California, United States / icbm://+37.20.07/-121.53.38 \ "I've got the fever for the / flavor of a cracker" / Ice Cube