|
Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
|
One stack per fiber, mapped with a guard page at the low end so an overflow faults deterministically instead of corrupting a neighbour. More...
#include <fiber.h>
Data Fields | |
| void * | start |
| High end, stack pointer initialises to this address. | |
| void * | limit |
| Low end of usable region. | |
| void * | guard |
| The protected page to detect stack overflows. | |
One stack per fiber, mapped with a guard page at the low end so an overflow faults deterministically instead of corrupting a neighbour.
With addresses increasing to the right, the layout is:
|... guard page ...|.......... frames ..........| ^ guard ^ limit ^ start
guard is the mmap base, the lowest page of the region. The stack grows downward, so frames start at the high end (start) and grow toward limit; one step past limit lands on the protected guard page and faults.
| void* srn_fiber_stack_t::guard |
| void* srn_fiber_stack_t::start |