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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:9fc4:: with SMTP id i187-v6mr3697862ioe.28.1527794118203; Thu, 31 May 2018 12:15:18 -0700 (PDT) X-Received: by 2002:a9d:738f:: with SMTP id j15-v6mr333860otk.6.1527794117873; Thu, 31 May 2018 12:15:17 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder4.news.weretis.net!newsreader5.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!v8-v6no1154717itc.0!news-out.google.com!b185-v6ni1231itb.0!nntp.google.com!v8-v6no1154713itc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 31 May 2018 12:15:17 -0700 (PDT) In-Reply-To: <60552a08-2b32-4e76-bfd8-8d6341f57c8d@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a04:ae04:9408:b600:60b5:c067:c56b:2d50; posting-account=-SMKVgoAAAA8u8UnmI_NwOPA-LGqXugp NNTP-Posting-Host: 2a04:ae04:9408:b600:60b5:c067:c56b:2d50 References: <13ec49fb-8c1a-42a4-b1a2-3984d0e159f7@googlegroups.com> <60552a08-2b32-4e76-bfd8-8d6341f57c8d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5978890f-d203-4e67-8cbe-f9928c7afa3c@googlegroups.com> Subject: Re: Memory pools From: gorgelo@hotmail.com Injection-Date: Thu, 31 May 2018 19:15:18 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2703 X-Received-Body-CRC: 2125983030 Xref: reader02.eternal-september.org comp.lang.ada:52815 Date: 2018-05-31T12:15:17-07:00 List-Id: To followup on what I started to write upon. There are several different ki= nds of memory pools but what first comes to my mind is single task RAII (Re= source Acquisition Is Allocation) e.g. a pool is used during a subprogram/f= unction call. At subprogram entry a pool object is allocated on the stack a= nd then any subsequent heap allocations of objects are allocated inside the= pool instead of on the heap. Note that the pool object is allocated on the= stack but the objects it contains are stored on the heap in pre-allocated = heap memory or heap memory allocated on demand. When the pool object goes o= ut of scope all heap memory is deallocated. And for this scenario there are= two kinds of memory pools, bounded and unbounded. The pool implementations of Deepend are built upon the idea that allocated = objects (of varying sizes) are only allocated in the pool but never dealloc= ated. Using Unchecked_Deallocation for the pools in Deepend only results in= No-ops. For implementation of the Treap algorithm in Ada it is essential t= hat deallocations "work as expected" which rules out the usage of Deepend w= hich is what I usually use. Also note that when one uses Deepend one never = does any deallocations using Unchecked_Deallocation and that is taken care = of under the hood by Deepend.