|
From: | Paul Eggert |
Subject: | Re: new module 'aligned-malloc' |
Date: | Thu, 23 Jul 2020 13:03:49 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 7/23/20 5:24 AM, Florian Weimer wrote:
Ah, 4096 is too small. For large allocations (above the mmap threshold), what happens in the example is that the process VMA limit is eventually exhausted, at which malloc falls back to sbrk, and then the algorithm succeeds. I don't think it's a good idea to trigger ENOMEM, it's certainly not thread-safe.
I'm not sure I see what ENOMEM has to do with it if the algorithm is succeeding.Anyway, none of this matters since glibc has aligned_alloc already. All that matters is how well native MS-Windows performs since it's the only significant platform that lacks native support for aligned allocation. I don't use MS-Windows so I'm not the best person to comment on it; still, I'd be surprised if there's no way to support common uses of aligned_alloc on MS-Windows, such as the use that prompted this thread.
[Prev in Thread] | Current Thread | [Next in Thread] |