comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Bug in GNAT? - Max_size_in_storage_elements insufficient
Date: Wed, 19 Oct 2016 09:33:13 +0200
Date: 2016-10-19T09:33:13+02:00	[thread overview]
Message-ID: <nu77jp$157e$1@gioia.aioe.org> (raw)
In-Reply-To: 647636100.498533813.258228.laguest-archeia.com@nntp.aioe.org

On 19/10/2016 03:39, Luke A. Guest wrote:
> Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
>
>>> Well, then it's at least a bug in [Barnes] because there's an example
>>> like the above ones just with a simpler type. But I still think the idea
>>> here is/was to provide enough space for N items of some type.
>>
>> I am not sure if that were technically possible. Considering an
>> implementation of, for example, a marked-margins pool, the penalty to
>> have a guarantee would be extremely high.
>
> Surely that's what a static language can supply, the actual amount of space
> required?

In the mentioned above method you allocate a "margin" in front and in 
the end of each block. The margin contains an indicator if the block is 
free and the block size. When a block is freed the margins of adjacent 
blocks are inspected and the block is merged with its free neighbors. 
The memory overhead depends on the number of blocks, which in turn 
depends on the number of allocated objects and on how their blocks are 
distributed. In the worst case scenario you have a gap between each two 
allocated blocks. Which gives 2 * (2*N - 1) - 2 margins to keep in the pool.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2016-10-19  7:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18 11:17 Bug in GNAT? - Max_size_in_storage_elements insufficient Vratislav Podzimek
2016-10-18 12:35 ` Dmitry A. Kazakov
2016-10-18 15:26   ` Vratislav Podzimek
2016-10-18 16:03     ` Dmitry A. Kazakov
2016-10-19  1:39       ` Luke A. Guest
2016-10-19  7:33         ` Dmitry A. Kazakov [this message]
2016-10-20  0:59         ` Randy Brukardt
2016-10-19 15:45     ` Eryndlia Mavourneen
2016-10-19 15:53     ` Eryndlia Mavourneen
2016-10-19 13:34 ` Egil H H
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox