How the Nasal GC works: Difference between revisions

Jump to navigation Jump to search
m
Line 44: Line 44:
= naNew() =
= naNew() =


As can be seen, the key allocator function is [https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/misc.c#line66 naNew()]. naNew() is really just a fancy malloc() replacement, i.e. it's just getting passed the context, and the nasal type (which is mapped to the size of the requested memory region using naTypeSize()).
As can be seen, the key allocator function is [https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/misc.c#line66 naNew()]. naNew() is really just a fancy malloc() replacement, i.e. it's just getting passed the Nasal execution context, and the nasal type (which is mapped to the size of the requested memory region using naTypeSize()).


The naNew() function is also implemented in misc.c, see [https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/misc.c#line122 line 66]:
The naNew() function is also implemented in misc.c, see [https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/misc.c#line122 line 66]:

Navigation menu