YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

sq_wakeupvm behaviour
Hop
#1 Posted : Wednesday, January 3, 2018 8:06:59 PM(UTC)
Rank: Member

Groups: Registered
Joined: 1/19/2015(UTC)
Posts: 12
Location: UK

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
When sq_call is called, and execution of the function is suspended through sq_suspendvm(), the closure and the arguments will not be automatically popped from the stack. This makes sense because the VM can later be woken up by calling sq_wakeupvm, which will needs to start the VM from where it left off.

My question is, when sq_wakeupvm is called and execution of the function resumes and exits, leaving the VM in the IDLE state - not suspended - why are the closure and the arguments not automatically popped from the stack?

It would make sense if sq_wakeupvm is called and execution of the function is suspended again through sq_suspendvm() for the closure and the arguments not to be automatically popped from the stack. But if the VM is not suspended why doesn't it pop the closure and args?

absence
#2 Posted : Saturday, January 6, 2018 3:13:56 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 8/23/2014(UTC)
Posts: 122
Man
Location: Northern Germany & Lincolnshire, U.K.

Thanks: 1 times
Was thanked: 10 time(s) in 10 post(s)
Answer: you must not call sq_call on a suspended VM, simply because it actually already IS RIGHT WITHIN A CALL when it suspends, which then is to clean the stack when it finishes (wakeup).
The only way to suspend a VM is upon return of a call!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.076 seconds.