Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
Loading...
Searching...
No Matches
srn_fiber_stack_t Struct Reference

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.

Detailed Description

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.

Definition at line 218 of file fiber.h.

Field Documentation

◆ guard

void* srn_fiber_stack_t::guard

The protected page to detect stack overflows.

Definition at line 224 of file fiber.h.

◆ limit

void* srn_fiber_stack_t::limit

Low end of usable region.

Definition at line 222 of file fiber.h.

◆ start

void* srn_fiber_stack_t::start

High end, stack pointer initialises to this address.

Definition at line 220 of file fiber.h.


The documentation for this struct was generated from the following file: