File: vm_initialization.rst

package info (click to toggle)
squirrel3 3.1-8.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,380 kB
  • sloc: cpp: 12,722; ansic: 917; makefile: 316; python: 40
file content (21 lines) | stat: -rw-r--r-- 647 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
.. _embedding_vm_initialization:

==============================
Virtual Machine Initialization
==============================

The first thing that a host application has to do, is create a virtual machine.
The host application can create any number of virtual machines through the function
*sq_open()*.
Every single VM that was created using *sq_open()* has to be released with the function *sq_close()* when it is no
longer needed.::

    int main(int argc, char* argv[])
    {
        HSQUIRRELVM v;
        v = sq_open(1024); //creates a VM with initial stack size 1024

        //do some stuff with squirrel here

        sq_close(v);
    }