From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5d71,d275ffeffdf83655 X-Google-Attributes: gidf5d71,public X-Google-Thread: 109fba,d275ffeffdf83655 X-Google-Attributes: gid109fba,public X-Google-Thread: 1108a1,d275ffeffdf83655 X-Google-Attributes: gid1108a1,public X-Google-Thread: 115aec,d275ffeffdf83655 X-Google-Attributes: gid115aec,public X-Google-Thread: 101b33,d275ffeffdf83655 X-Google-Attributes: gid101b33,public X-Google-Thread: 146b77,d275ffeffdf83655 X-Google-Attributes: gid146b77,public X-Google-Thread: f849b,d275ffeffdf83655 X-Google-Attributes: gidf849b,public X-Google-Thread: 103376,d275ffeffdf83655 X-Google-Attributes: gid103376,public From: phil@ricochet.net (phil) Subject: Re: Ada vs C++ vs Java Date: 1999/01/17 Message-ID: <36a1b97d.54731940@news.ricochet.net>#1/1 X-Deja-AN: 433601756 References: <369C1F31.AE5AF7EF@concentric.net> <369DDDC3.FDE09999@sea.ericsson.se> <369e309a.32671759@news.demon.co.uk> <369F0592.94F9DDDA@dresdner-bank.com> <77pnr4$ch3$1@newnews.global.net.uk> X-Complaints-To: newsabuse@remarQ.com X-Trace: 916570232 F7W8ZAFJM8238CCB3C usenet77.supernews.com Organization: Posted via RemarQ, http://www.remarQ.com - Discussions start here! Newsgroups: comp.lang.ada,comp.lang.c++,comp.vxworks,comp.lang.java,comp.java.advocacy,comp.realtime,comp.arch.embedded,comp.object,comp.lang.java.programmer Date: 1999-01-17T00:00:00+00:00 List-Id: On Sun, 17 Jan 1999 06:53:08 GMT, Matthew Heaney wrote: >"John Birch" writes: > >> The reason IMHO is that C++ inherently relies upon dynamic memory >> allocation! It's really as simple as that. If you can show me how to >> calculate the maximum amount of memory required by a given C++ program then >> I'll reconsider, until then I'll continue using C without malloc and free! > >When does C++ "inherently rely upon dynamic memory allocation"? > OK, it doesn't, but i think that one of the potential problems is that dynamic allocation has been easily facilitated and also potentially quite well hidden. A bigger concern i have is over the use of library functions that either come with the compiler or are available from third party vendors that may well get involved in their own allocation strategies (and it is becoming difficult to police their use). However, i also agree that unless you really know what the compiler is up to, you may well be doing dynamic allocation on the heap or the stack without actually being aware of the fact through any sort of explicit indication. My memory allocation scheme has always been to either statically obtain the memory i need within the image map or obtain it during system startup and fail if unsucessful if an inability to obtain the memory at run time would lead to a critical failure. An unsuspecting use or abuse of a string class or whatever could compromise this quite easily, even maybe a function call where some sort of copy constructor is involved (compromising the stack for example). I think C++ is a really enjoyable language, but its abstractions are certainly higher than C and it does come with an attitude. phil.