Paul Eggert <[email protected]> writes:

> On 2025-09-10 18:55, Bruno Haible wrote:
>> aligned_alloc won't help here: On the platforms without posix_memalign
>> (namely, native Windows, see above), we don't have an aligned_alloc
>> implementation.
>
> If MS-Windows is the only platform without posix_memalign, perhaps we
> should use _aligned_malloc and _aligned_free functions on that
> platform. Then we can stop using mmap and malloc entirely, and there
> will be no need for a linked list or for a more-complicated data
> structure.

That makes sense to me.

Bruno is probably right, though. I'm curious about the length of the
list. A red-black tree, for example, would probably fix the performance
of get_memnode. But it would be more work for new_memnode. Currently, it
places the node at the head of the list. Since I expect that function is
called a lot, slowing down insertions seems like it can add up.

Collin

Reply via email to