From: David Gibson Date: Fri, 20 Jan 2017 12:49:43 +0000 (+1100) Subject: coroutine: Stack allocation X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=b4f0767d388c7f3629666400f48ede1a7b4be7f5;hp=b4f0767d388c7f3629666400f48ede1a7b4be7f5 coroutine: Stack allocation At present, coroutine stacks must be allocated explicitly by the user, then initialized with coroutine_stack_init(). This adds a new coroutine_stack_alloc() function which allocates a stack, making life easier for users. coroutine_stack_release() will automatically determine if the given stack was set up with _init() or alloc() and act accordingly. The stacks are allocate with mmap() rather than a plain malloc(), and a guard page is added, so an overflow of the stack should result in a relatively debuggable SEGV instead of random data corruption. Signed-off-by: David Gibson ---