Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: "Wayne K. Werner" Newsgroups: scea.yaroze.programming.codewarrior Subject: Re: Initializing the heap Date: 31 Oct 1997 20:19:58 GMT Organization: WermX Software Lines: 38 Message-ID: <01bce639$f3382a80$78bf43ce@wkwerner> References: <01bce566$fdb8c1a0$a5bf43ce@wkwerner> <34596659.40D5@charlie.cns.iit.edu> <01bce5de$a390af80$6fbf43ce@wkwerner> <3459c0fd.1431258@news.playstation.co.uk> NNTP-Posting-Host: port20.con2.com X-Newsreader: Microsoft Internet News 4.70.1161 Gil Jaysmith wrote: > Everyone seems to enjoy assuming that GNU should be changed to fit in > with someone else's compiler which they happen to be using. Why > exactly is this? (GNU predates CodeWarrior; CodeWarrior could be > considered wrong on that basis for everything different which it > does.) Heap management is a library thing, not a language thing. Must disagree with you there. Yes, the heap is implemented by library calls, but these are part of the required ANSI C stdlib, and in no ANSI C compliant compiler that I have ever seen is the user required to init the heap. It is just not part of the standard. Having to do this removes compliance for no good reason that I can see. In C++, operator new and delete are part of the language, and their use requires no user initialization either. Who was here first is not the issue, but which platform is (was) doing things in an ANSI compliant manner is. > It's too bad that > you have to do this differently depending on the platform, but #ifdef > was invented for situations like this. Sure, that's what conditional compile directives are for. But they obscure code and cause maintainence hassels. They are an evil evoked only when needed. In the case of heap initialization, they shouldn't appear at all... like I said, if heap init is where it belongs, in the startup code, heap size handled by instructions to the compiler/linker, then the heap init issue is no issue at all. -- Wayne K. Werner wkwerner@con2.com