3 ms·
Stack buffers are allocated in the heap (by the "default" rr.c implementation of usched::s_alloc()). Allocating them on the stack, as you seem to be proposing,
by nikita_d 4y ago
Stack buffers are allocated in the heap (by the "default" rr.c implementation of usched::s_alloc()). Allocating them on the stack, as you seem to be proposing, is a really clever idea: you can do something like rr_thread_init(&startfunc, arg, alloca(BUFFERSIZE)). The buffer is freed when the coroutine is terminated (rr_done()).