|
|
|
|
|
by jashmatthews
2398 days ago
|
|
Is this universally true? Redis for example vendors jemalloc so it’s entirely possible for malloc to mostly inline? IIUC malloc isn’t a syscall like the underlying sbrk and mmap calls that malloc implementations use to get memory from the kernel? |
|
But if you cannot move memory (adjust pointers like most GCs do) then you will have to deal with fragmentation, which slows down allocation (or causes other drawbacks).
Moving GC can also make the program faster due to memory compactation and hence being more efficient wrt CPU cache and TLB.