[fpc-pascal] Coroutines and VirtualAlloc

Sven Barth pascaldragon at googlemail.com
Wed Apr 19 11:14:57 CEST 2017


Am 19.04.2017 06:35 schrieb "Ryan Joseph" <ryan at thealchemistguild.com>:
>
>
> > On Apr 19, 2017, at 2:34 AM, Daniel Gaspary <dgaspary at gmail.com> wrote:
> >
> > Using  SetJmp and LongJmp?
> >
> > I believe some months ago it was a discussion on the list on why this
> > was not really the way to implement coroutines.
> >
> > Searching for longjmp/setjmp you can find the thread, I guess.
>
> I never heard of those functions and I did find a thread about them but
it seemed inconslusive.

Those functions simply store (setjmp) and restore (longjmp) register values
(and setjmp also returns the value passed to longjmp if it had been reached
by a longjmp). Nothing more, nothing less. So while the stack register
while be changed, the contents on the stack will not.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170419/13b117c9/attachment.html>


More information about the fpc-pascal mailing list