2 ms·
On Linux, mmap() is your signal-safe malloc. POSIX doesn't require mmap() to be async-signal safe, but on Linux it de facto is. Of course, doing every memory
by skissane 2y ago
On Linux, mmap() is your signal-safe malloc.
POSIX doesn't require mmap() to be async-signal safe, but on Linux it de facto is.
Of course, doing every memory allocation at the kernel level is going to be very slow and resource intensive. But if it isn't on a hot code path...