20,741
edits
mNo edit summary |
|||
| Line 70: | Line 70: | ||
The 7 storage pools are declared in code.h as part of the "Globals" structure, line 39: https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/code.h#line39 | The 7 storage pools are declared in code.h as part of the "Globals" structure, line 39: https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/code.h#line39 | ||
The relevant part is: | |||
<syntaxhighlight lang="C"> | |||
struct Globals { | |||
// Garbage collecting allocators: | |||
struct naPool pools[NUM_NASAL_TYPES]; | |||
int allocCount; | |||
// Dead blocks waiting to be freed when it is safe | |||
void** deadBlocks; | |||
int deadsz; | |||
int ndead; | |||
//... | |||
}; | |||
</syntaxhighlight> | |||
== The Globals structure == | |||
<syntaxhighlight lang="C"> | <syntaxhighlight lang="C"> | ||
| Line 112: | Line 130: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== The naPool structure == | |||
The layout of the Nasal memory structure pool can be found in data.h, line 172: https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/data.h#line172 | The layout of the Nasal memory structure pool can be found in data.h, line 172: https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/data.h#line172 | ||