From 87e065ede2bae2d72dc1c39e15d8f7a391d6dda3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 15 Dec 2022 20:52:45 +0000 Subject: mymalloc: add notes on the malloc implementation --- mymalloc.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mymalloc.h b/mymalloc.h index 7d94246..2e0517b 100644 --- a/mymalloc.h +++ b/mymalloc.h @@ -6,6 +6,19 @@ * adds wait-free free(3) multi-threading support to avoid contention * with call_rcu. + * The wait-free free(3) implementation was proposed for inclusion into + glibc in 2018 and may eventually become part of glibc: + https://inbox.sourceware.org/libc-alpha/20180731084936.g4yw6wnvt677miti@dcvr/ + + * Arenas are thread-local and returned to a global pool upon thread + destruction. This works well for processes with stable thread counts, + but wastes memory in processes with unstable thread counts. + + * On Linux with O_TMPFILE support, all allocations are backed by + a temporary file (in TMPDIR). This avoids OOM errors on + memory-constrained systems due to the higher-than-normal memory + usage of mwrap itself. + * memalign-family support is ignored (and reimplemented in mwrap_core.h). dlmalloc's attempts to improve memory-efficiency is prone to fragmentation if memaligned-allocations are repeatedly freed and relalocated while -- cgit v1.2.3-24-ge0c7