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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newshub.sdsu.edu!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!tsicnews.teliasonera.com!news.otenet.gr!news.grnet.gr!newsfd02.forthnet.gr!not-for-mail From: Ioannis Vranos Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada) Date: Fri, 11 Mar 2005 16:39:25 +0200 Organization: FORTHnet S.A., Atthidon 4, GR-17671 Kalithea, Greece, Tel: +30 2109559000, Fax: +30 2109559333, url: http://www.forthnet.gr Message-ID: <1110551982.626873@athnrd02> References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1lr611thktbau$.1dj95z21h7l5v.dlg@40tude.net> <97kpu5gkgo1r$.kc4nx7cxjziw$.dlg@40tude.net> <1110543138.32171@athnrd02> NNTP-Posting-Host: athnrd02.forthnet.gr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: athprx02.forthnet.gr 1110551982 14526 193.92.150.73 (11 Mar 2005 14:39:42 GMT) X-Complaints-To: abuse@forthnet.gr NNTP-Posting-Date: Fri, 11 Mar 2005 14:39:42 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en In-Reply-To: Cache-Post-Path: newsfd02!unknown@ppp16-adsl-170.ath.forthnet.gr Xref: g2news1.google.com comp.lang.ada:9138 comp.lang.c++:45138 comp.realtime:1279 comp.software-eng:4845 Date: 2005-03-11T16:39:25+02:00 List-Id: Dmitry A. Kazakov wrote: > Even if exception object is 100GB large? I am talking about the exception class bad_alloc whatever the sizes of other objects (even exceptions) are. It is guaranteed that there is always free memory for bad_alloc. > Stack here means LIFO. It is not necessarily the machine stack, though in > most cases it will be. I think there is no need to explain why LIFO > allocation / deallocation strategy is in order of magnitude more efficient > than heap? Neither should I explain why local to task (thread) memory is > better than the global heap in any concurrent program and especially in > ones running on multi-processor machines... Although I know the general difference between stack and heap (the last storing things in a messy way), I have no knowledge about them in terms of program's space (that is how the heap can be rearranged in the background), so it is better someone else to answer this. However in general what I know is that the additional time-cost of dynamic storage in comparison to the automatic storage can be described as the additional cost of new and delete calls. >>Are you familiar with "Resource Acquisition is Initialisation" (RAII) >>technique? This is supported by C++ and used by all standard library >>containers. > > > = smart pointers. Yes. It is a widely used technique to regain the safety > lost while switching from stack to heap. It adds additional performance / > space penalty to what heap already has. Smart pointers, as also containers, but even for resources other than memory. -- Ioannis Vranos http://www23.brinkster.com/noicys