10 //max number of character for a printed number
11 #define NUMBER_MAX_CHAR 50
13 struct VXStringObjTable
15 VXStringObjTable(VXSharedState
*ss
);
17 VXStringObj
*Add(const char *,VXInteger len
);
18 void Remove(VXStringObj
*);
20 void Resize(VXInteger size
);
21 void AllocNodes(VXInteger size
);
22 VXStringObj
**_strings
;
23 VXUnsignedInteger _numofslots
;
24 VXUnsignedInteger _slotused
;
25 VXSharedState
*_sharedstate
;
33 VXUnsignedInteger refs
;
38 void AddRef(VXRawObj
&obj
);
39 bool Release(VXRawObj
&obj
);
40 VXUnsignedInteger
GetRefCount(VXRawObj
&obj
);
41 #ifndef NO_GARBAGE_COLLECTOR
42 void Mark(VXCollectable
**chain
);
46 RefNode
*Get(VXRawObj
&obj
,VXHash
&mainpos
,RefNode
**prev
,bool add
);
47 RefNode
*Add(VXHash mainpos
,VXRawObj
&obj
);
48 void Resize(VXUnsignedInteger size
);
49 void AllocNodes(VXUnsignedInteger size
);
50 VXUnsignedInteger _numofslots
;
51 VXUnsignedInteger _slotused
;
57 #define ADD_STRING(ss,str,len) ss->_stringtable->Add(str,len)
58 #define REMOVE_STRING(ss,bstr) ss->_stringtable->Remove(bstr)
68 char* GetScratchPad(VXInteger size
);
69 VXInteger
GetMetaMethodIdxByName(const VXObject
&name
);
70 #ifndef NO_GARBAGE_COLLECTOR
71 VXInteger
CollectGarbage(VXState
*vm
);
72 void RunMark(VXState
*vm
,VXCollectable
**tchain
);
73 VXInteger
ResurrectUnreachable(VXState
*vm
);
74 static void MarkObject(VXObject
&o
,VXCollectable
**chain
);
76 VXObjectVec
*_metamethods
;
77 VXObject _metamethodsmap
;
78 VXObjectVec
*_systemstrings
;
80 VXStringObjTable
*_stringtable
;
84 VXObject _constructoridx
;
85 #ifndef NO_GARBAGE_COLLECTOR
86 VXCollectable
*_gc_chain
;
89 VXObject _table_default_delegate
;
90 static VXRegFunction _table_default_delegate_funcz
[];
91 VXObject _array_default_delegate
;
92 static VXRegFunction _array_default_delegate_funcz
[];
93 VXObject _string_default_delegate
;
94 static VXRegFunction _string_default_delegate_funcz
[];
95 VXObject _number_default_delegate
;
96 static VXRegFunction _number_default_delegate_funcz
[];
97 VXObject _generator_default_delegate
;
98 static VXRegFunction _generator_default_delegate_funcz
[];
99 VXObject _closure_default_delegate
;
100 static VXRegFunction _closure_default_delegate_funcz
[];
101 VXObject _thread_default_delegate
;
102 static VXRegFunction _thread_default_delegate_funcz
[];
103 VXObject _class_default_delegate
;
104 static VXRegFunction _class_default_delegate_funcz
[];
105 VXObject _instance_default_delegate
;
106 static VXRegFunction _instance_default_delegate_funcz
[];
107 VXObject _weakref_default_delegate
;
108 static VXRegFunction _weakref_default_delegate_funcz
[];
110 VXCompileError _compilererrorhandler
;
111 VXPrintFunction _printfunc
;
112 VXPrintFunction _errorfunc
;
114 bool _notifyallexceptions
;
117 VXInteger _scratchpadsize
;
120 #define _table_ddel _table(_sharedstate->_table_default_delegate)
121 #define _array_ddel _table(_sharedstate->_array_default_delegate)
122 #define _string_ddel _table(_sharedstate->_string_default_delegate)
123 #define _number_ddel _table(_sharedstate->_number_default_delegate)
124 #define _generator_ddel _table(_sharedstate->_generator_default_delegate)
125 #define _closure_ddel _table(_sharedstate->_closure_default_delegate)
126 #define _thread_ddel _table(_sharedstate->_thread_default_delegate)
127 #define _class_ddel _table(_sharedstate->_class_default_delegate)
128 #define _instance_ddel _table(_sharedstate->_instance_default_delegate)
129 #define _weakref_ddel _table(_sharedstate->_weakref_default_delegate)
133 //extern VXObject _null_;
135 bool CompileTypemask(VXIntVec
&res
,const char *typemask
);