20,741
edits
| Line 58: | Line 58: | ||
== Nasal memory pools == | == Nasal memory pools == | ||
For each of the 7 Nasal data types, there is a separate storage pool available. | For each of the 7 Nasal data types, there is a separate storage pool available, declared as part of the "Globals" structure. | ||
For example, '''globals->pools[T_VEC]''' refers to the storage pools for vectors: | |||
<syntaxhighlight lang="C"> | <syntaxhighlight lang="C"> | ||
globals->pools[T_VEC]; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
As can be seen, each storage pool is addressed by its enum index (0..6): https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/data.h#line65 | |||
<syntaxhighlight lang="C"> | <syntaxhighlight lang="C"> | ||
enum { T_STR, T_VEC, T_HASH, T_CODE, T_FUNC, T_CCODE, T_GHOST, NUM_NASAL_TYPES }; // V. important that this come last! | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 72: | Line 74: | ||
The relevant part is: | The relevant part is: | ||
<syntaxhighlight lang="C"> | <syntaxhighlight lang="C"> | ||