Am 05.03.20 um 23:25 schrieb Andrew Wesie:
Would it make sense to keep the heap allocation as a slow-path if the assumption about the allocation size is wrong? For example, if count is less than 32 use alloca(), otherwise use the heap to avoid a stack overflow.
Similar suggestion: If we keep the heap codepath anyway and have a max alloca size, would it make sense to have a fixed size local buffer instead of alloca for the fast case and heap_alloc if something huge comes along?