How the Nasal GC works: Difference between revisions

Jump to navigation Jump to search
m
Line 275: Line 275:


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().
'''Note:''' naGC_get() is the only function which really manages all memory pools and which triggers the GC. Allocations via naNew()* will end up calling naNew() and naNew() ends up calling naGC_get() '''always'''.


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
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

Navigation menu