Elektrine lite

← Feed

@harrysintonen@infosec.exchange

Post #2942462

2025-09-11 10:13 UTC

The fix to Gnulib is here: https://cgit.git.savannah.gnu.org/cgit/gnulib.git/commit/?id=7c96b402be00117225a6943ab53bb9e5e6e2c02b The most clean solution was to prefer posix_memalign over mmap. It was also pointed out that according to POSIX, mmap can return non-pagesize-aligned pointers, making my idea of avoiding the use of the list for the USE_MMAP case non-portable. It'd work for most platforms, but it could then break for some. This is something that Gnulib, of course, cannot do. Another idea was to use some more suitable data structure with a sensible search performance over the linked list. However, using a more exotic data structure (hash, tree, etc.) would likely be a bit of overkill and wasn't deemed worth the amount of code complexity it'd add. Finally, placing the allocation pointer in a negative offset of the aligned pointer would lead to significant allocation overhead due to it having to allocate at least one extra full page worth of memory - at least if the code would need to stay portable, as is the case with Gnulib.

Replies (0)

No replies.