Wiki source for browserPluginReturnIfNeeded


Show raw source

======**sqInt ioExit(void)**======
#define browserPluginReturnIfNeeded()

**Parms**: NONE
**return**: NONE, fake return of zero
**From**: Interpreter
**Why**:
To decide if we should exit the interpreter loop

**Responsibility**:
In the early days of running the virtual machine as a browser plugin it was designed that the VM would run on the same Thread as the browser, this required us to run the interpreter loop for a number of milliseconds then terminate control back to the caller so the browser's main thread could gain control. The browserPluginReturnIfNeeded would then get control every couple of milliseconds on a unconditional jump backwards, or on a message send, or on calling a primitive.

**MacIntosh**
//os-9/OSXCarbon//
#define browserPluginReturnIfNeeded() if (plugInTimeToReturn()) {ReturnFromInterpret();}
Where plugInTimeToReturn is returns true if gQuitNowRightNow is true.
#define ReturnFromInterpret() return

//Cocoa://
See iPhone

**iPhone**
#define browserPluginReturnIfNeeded() if (plugInTimeToReturn()) {ReturnFromInterpret();}
Where plugInTimeToReturn is returns true if gQuitNowRightNow is true.
#define ReturnFromInterpret() return

For testing of memory leakage we enable this so that we can terminate the interpreter loop on 'quit'

**Unix**

**Windows**

**BUGS**

Valid XHTML :: Valid CSS: :: Powered by WikkaWiki