How the Nasal GC works: Difference between revisions

Jump to navigation Jump to search
m
Line 140: Line 140:
== The naPool structure ==
== 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 structure keeping all pool-related information is named "naPool", the layout of the naPool structure can be seen in data.h, line 172: https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/data.h#line172
<syntaxhighlight lang="C">
<syntaxhighlight lang="C">
struct naPool {
struct naPool {
     int          type;
     int          type; // one of T_STR, T_VEC, T_HASH etc
     int          elemsz;
     int          elemsz; // size of each element - determiend via naTypeSize(T_*)
     struct Block* blocks;
     struct Block* blocks;
     void**  free0; // pointer to the alloced buffer
     void**  free0; // pointer to the alloced buffer

Navigation menu