From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!RKN7TKnHC01q0gdg6EhkbQ.user.46.165.242.75.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Custom Storage Pool questions Date: Sat, 18 Sep 2021 12:32:52 +0100 Organization: Aioe.org NNTP Server Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: gioia.aioe.org; logging-data="34245"; posting-host="RKN7TKnHC01q0gdg6EhkbQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:NC+W6Nrm2IZaey4QjPAK2Ah54hY= Xref: reader02.eternal-september.org comp.lang.ada:62774 List-Id: "Randy Brukardt" writes: > Not sure what you are expecting. There is no requirement that objects > are allocated contigiously. Indeed, Janus/Ada will call Allocate as > many times as needed for each object; for instance, unconstrained > arrays are in two parts (descriptor and data area). The referenced blog[1] says "As we mentioned before, we need to ensure that the bounds for unconstrained arrays are stored next to the element, not in a separate memory block, to improve performance. This is done by setting the Size attribute on the type. When we set this size to that of a standard pointer, GNAT automatically changes the layout, so that we now have: +-------+------+---------+ | First | Last | Element | +-------+------+---------+ I _think_ I was aware of this before, in fact I remember using it, but not where! Is it documented anywhere? [1] https://blog.adacore.com/header-storage-pools