|
From: | Paul Eggert |
Subject: | Re: new module 'aligned-malloc' |
Date: | Wed, 22 Jul 2020 15:07:57 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 7/21/20 4:29 PM, Bruno Haible wrote:
I don't think performance would be that bad, for many applications at least. I suppose we could measure overall performance if the topic ever comes up. Of course this performance issue is mostly just for MS-Windows, as other major current platforms already have aligned_alloc or rough equivalent.However, the algorithm above would be _grossly_ inefficient - especially for bigger alignments such as 128 or 512.
In a lot of code I've seen, allocation and deallocation of some data type is done nearby in the code; then it's not a big burden to use xyz_free for the results of xyz_alloc.
True, and for these, aligned_malloc is OK. But I would rather not have "we should be compatible with aligned_malloc" leak into a bunch of other modules. As I see it, aligned_malloc is a crutch for MS-Windows (plus some less-important nonstandard platforms) and it shouldn't be driving our code or our APIs.
[Prev in Thread] | Current Thread | [Next in Thread] |