-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Description
The example given in the Boost documentation gives make_fcontext as taking a block of heap memory for the new stack. In the example, pointer from malloc is given directly to make_fcontext. However, the behaviour of make_fcontext is architecture dependent. It either expects a pointer to the bottom of the stack (consistent with the result of malloc) or the top of the stack (which requires pointer arithmetic to derive the end of the malloc block)
Code that uses this interface is therefore non-portable. Since the size of the stack is always passed to make_fcontext it would be trivial to update the assembler implementation to ALWAYS expect a pointer to the bottom of the stack, making interfacing code portable again.
Metadata
Metadata
Assignees
Labels
No labels