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,4fe0da28a190b761,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.de!news.belwue.de!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Storage management Date: Sat, 01 Nov 2008 12:13:01 +0100 Message-ID: <87fxmbog1u.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: idssi.enyo.de 1225537981 23233 212.9.189.177 (1 Nov 2008 11:13:01 GMT) X-Complaints-To: Cancel-Lock: sha1:zCxHg9LW/c4pS0vJhgVe38r6cpQ= Xref: g2news1.google.com comp.lang.ada:2544 Date: 2008-11-01T12:13:01+01:00 List-Id: What is the current state of the art with regard to programmer support for storage management? With GNAT, Ada.Finalization adds tons of run-time calls to deal with abort deferral (even with pragma Restrictions (No_Abort_Statements)), puts the object on some sort of list, and does some secondary stack allocations which I don't understand. Clearly, this is not supposed to be used in performance-critical code, so I doubt it can be used for a generic smart pointer implementation. (Object allocation in inner loops is generally a bad idea, but this overhead is also incurred when copying smart pointers around.) Is there some other approach? Can limited types be used to enforce linearity (in the sense of linear types, cf. and )? If it's about pure storage management, GC support would be an option, too, but AFAIK, you need one of the managed code implementations for that, or somewhat unsafe libraries (in the sense that you need to specify which objects are leaf objects, and only store access values in locations where they are visible to the collector).