Hacker News new | past | comments | ask | show | jobs | submit login

malloc(sizeof(foo)) is slower than alloc_foo() because the latter can simply be a pointer increment, but there is no way to tell the malloc() interface that you're going to be doing nothing but allocating foo for a while.

malloc() can guess this with heuristics, but a good malloc() needs to perform well for a wide variety of use cases: Surely you can appreciate that balance has a cost that the specialised allocator simply doesn't have to pay.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: