4 ms·
> They are simply making sure those interfaces are not actively hostile to languages that aren't C ... I.e. not actively small and fast, like an OS should be.
by kazinator 6y ago
> They are simply making sure those interfaces are not actively hostile to languages that aren't C ...
I.e. not actively small and fast, like an OS should be.
- geofft 6y ago1. This claim needs benchmarking. 2. Linux is already moving in the direction of having easier-to-use internal interface over small, fast, and tricky ones. For kmalloc in particular, the memory management docs https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html https://www.kernel.org/doc/html/latest/core-api/memory-alloc... recommends kzalloc (which zeroes data) and suggests a function called kvmalloc which calls either kmalloc or vmalloc depending on the size of the allocation. It unconditionally recommends kvfree (which handles alloations from either kmalloc or vmalloc) instead of asking you to use kfree or vfree as appropriate. 3. In this particular case, kmalloc is inlined because it calls krealloc(NULL, ...). This could almost certainly be equivalently handled by inlining the other side of it. (Again, benchmarking.) 4. LTO is a thing.
- deleted 6y ago[deleted]