4 ms·
I feel like the real thing that needs to change is we need a more expressive allocation interface than just malloc/realloc. I'm sure that memory allocators coul
by IshKebab 8mo ago
I feel like the real thing that needs to change is we need a more expressive allocation interface than just malloc/realloc. I'm sure that memory allocators could do a significantly better job if they had more information about what the program was intending to do.
- liuliu 8mo agoThere are, look no further than jemalloc API surface itself: https://jemalloc.net/jemalloc.3.html https://jemalloc.net/jemalloc.3.html One thing to call out: sdallocx integrates well with C++'s sized delete semantics: https://isocpp.org/files/papers/n3778.html https://isocpp.org/files/papers/n3778.html
- hedora 8mo agoYou can also play tricks with inlining and constant propagation in C (especially on the malloc path, where the ground-truth allocation size is usually statically known).