How the Nasal GC works: Difference between revisions

Jump to navigation Jump to search
m
Line 65: Line 65:
First, the conditional checks if there's any free memory in the Nasal storage pools  for the requested Nasal data type, if there isn't any free memory left, new memory is assigned to the contexts->free[type] pool via naGC_get().
First, the conditional checks if there's any free memory in the Nasal storage pools  for the requested Nasal data type, if there isn't any free memory left, new memory is assigned to the contexts->free[type] pool via naGC_get().


OBJ_CACHE_SZ is defined in code.h, line 12: https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/code.h#line12
For the time being, OBJ_CACHE_SZ can be ignored, it's defined in code.h, line 12: https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/code.h#line12
<syntaxhighlight lang="C">
<syntaxhighlight lang="C">
// Number of objects (per pool per thread) asked for using naGC_get().
// Number of objects (per pool per thread) asked for using naGC_get().
Line 76: Line 76:
#define OBJ_CACHE_SZ 1
#define OBJ_CACHE_SZ 1
</syntaxhighlight>
</syntaxhighlight>
The final argument to the naGC_get() function is a pointer to to the context's nfree[type] member which is updated by the function.


= Pool storage =
= Pool storage =

Navigation menu