20,741
edits
| Line 209: | Line 209: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
As can be seen, the garbage collector itself is triggered by setting the global "needGC" flag to 1 in the globals structure and then calling the bottleneck() function: [https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c#line199]. | |||
In line 209, the memory region from the global pool is cast to a pointer (struct naObj**): https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c#line209 | |||
In line 209, the memory region from the global pool is cast back to a pointer (struct naObj**): https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c#line209 | |||
the "nout" paramter is just there to update c->nfree[type] with the amount of free memory. | the "nout" paramter is just there to update c->nfree[type] with the amount of free memory. | ||