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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Allocators design flaw Date: Sat, 14 Oct 2017 17:13:42 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="e53c3a1e14119dea7f561d1d98279ae1"; logging-data="32464"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19oIjQN81LcqkVDlYndj0RlA/Dw7vshjpc=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:h5pd+SaUtGhwYqVFm3cBOeCfabU= sha1:83B4Ip7EUD5KyCWMejAQJL5zGJs= Xref: news.eternal-september.org comp.lang.ada:48469 Date: 2017-10-14T17:13:42+01:00 List-Id: Victor Porton writes: > As far as I understand, it will not work, because the C library I am > writing bindings for may try to free an object allocated by me (or I > my need to free an object allocated by the library). This vital info wasn't part of your original problem statement. I suppose you might just get away with creating a storage pool backed up by raptor_alloc_memory() (and corresponding free). But you'd have to cope with the alignment issue as Dmitry has suggested. Is the Ada side meant to understand things allocated on the C side? If so, you'll need to specify the representation exactly. Is the C side meant to understand things allocated on the Ada side? Likewise (and no room for hidden dope vectors!)