Re:Drop millions of allocations by using a linked list (2015)
by CyberDildonics on Friday March 12, 2021 @09:06AM
(#26435920)
That doesn't contain calls to sbrk at all, it maps memory in with mmap which is typical of every modern memory allocator.
Re:Drop millions of allocations by using a linked list (2015)
by quantumofalpha on Friday March 12, 2021 @01:53PM
(#26439404)
It uses both brk/sbrk ("__brk()" in that code) and mmap, the latter for allocating larger bits of memory. GNU libc does the same thing from what I remember from straces.
AFAIK also malloc will call sbrk quite a lot, at least from my cursory reading of this musl implementation[0].
[0] https://git.musl-libc.org/cgit/musl/tree/src/malloc/malloc.c...