
thanks Vicente for the review work --- Saturday 14-may-11, Vicente BOTET <vicente.botet@wanadoo.fr> wrote:
2. The stack implementation must ensure that the stack is unwound before it is destroyed. A stack should only be safely deallocated if either has been completely unwound or if it doesn't own any resources.
A basic stack without protection seems mandatory.
I'm assuming you mean that the built-in stack implementations that the library will provide (a mmap-protected and a unprotected implementation) will provide unwinding cleanup by default, however if i understand correctly, you will not guarantee that a user stack implementation will have to unwind too, or by any chance will the unwind happen outside of the stack implementation? i'm asking because, and i'm not sure if you (or boost) will consider this as a valid use case that should be allowed, but its possible that the user will want to deliver its own stack unwinding mechanism, for example, if the context is running JIT code generated from LLVM, the code generation might take care of explicitly unwinding the stack locals. In this case, forcing a new unwind might cause undefined behaviour. As long as the unwinding is optional to the user, i think its great to provide it by default Charles J. Quarra