| Home | Libraries | People | FAQ | More

## Rationale

#### No inline-assembler

Some newer compiler (for instance MSVC 10 for x86_64 and itanium) do not support inline assembler. [1].

#### fcontext_t

Boost.Context provides the low level API fcontext_t which is implemented in assembler to provide context swapping operations. fcontext_t is the part to port to new platforms.

| Note
Context switches do not preserve the signal mask on UNIX systems.

Because the assembler code uses the byte layout of fcontext_t to access its members fcontext_t must be a POD. This requires that fcontext_t has only a default constructor, no visibility keywords (e.g. private, public, protected), no virtual methods and all members and base clases are PODs too.

#### Protecting the stack

Because the stack's size is fixed -- there is no support for split stacks yet -- it is important to protect against exceeding the stack's bounds. Otherwise, in the best case, overrunning the stack's memory will result in a segmentation fault or access violation and, in the worst case, the application's memory will be overwritten. `stack_allocator` appends a guard page to the stack to help detect overruns. The guard page consumes no physical memory, but generates a segmentation fault or access violation on access to the virtual memory addresses within it.

[1] MSDN article 'Inline Assembler'