From: "Tony O'Bryan" Newsgroups: comp.os.msdos.djgpp Subject: Re: How big can I make my array? Date: Wed, 10 Jun 1998 19:00:30 +0000 Organization: Southwest Missouri State Universtiy Lines: 20 Message-ID: <357ED7CD.6B9D2F0F@nic.smsu.edu> References: <3578C43D DOT F4DDB90 AT cs DOT com> <357AB3E4 DOT 316B4ED2 AT cs DOT com> <357c0c3a DOT 24494159 AT news DOT Austria DOT EU DOT net> <357C8BB7 DOT 72AB4B6D AT alcyone DOT com> <357ead02 DOT 3535813 AT news DOT Austria DOT EU DOT net> NNTP-Posting-Host: jim.a03.smsu.edu 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 Gerhard Gruber wrote: > Aha? I thought that new usually uses malloc? I would be surprised if the C++ standard requires malloc to be the backend for new. Most likely not, though. Not even as a convenience for the compiler writers. In either event, it's not relevant since new and malloc are totally incompatible systems of memory allocation. new knows about constructors (among other things), and malloc doesn't. By the same token, delete knows about destructors and free doesn't. The two systems track memory in totally different ways, and one will not properly clean up memory created by the other. There are many other reasons, too, but I just wanted to cover the basics. You can, though, use malloc/free and new/delete in the same program as long as you use them consistently. People who say to never use malloc in C++ programs are just purists who think malloc should be eliminated.