How the Nasal GC works: Difference between revisions

Jump to navigation Jump to search
m
Line 173: Line 173:


As can be seen, "elemsz"  just stores the size of each type-specific structure, so that it can be used for new allocations.
As can be seen, "elemsz"  just stores the size of each type-specific structure, so that it can be used for new allocations.
naGC_init is called in initGlobals() in code.c for each Nasal type (T_STR, T_VEC etc): https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/code.c#line170
<syntaxhighlight lang="C">
for(i=0; i<NUM_NASAL_TYPES; i++)
        naGC_init(&(globals->pools[i]), i);
</syntaxhighlight>


The size of a memory pool is determined using poolsize(): https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c#line186
The size of a memory pool is determined using poolsize(): https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c#line186

Navigation menu