How the Nasal GC works: Difference between revisions

Jump to navigation Jump to search
m
Line 340: Line 340:


This checks if globals->bottleneck is true, and if it is, it makes sure that the bottleneck() function is only invoked after acquiring a lock.
This checks if globals->bottleneck is true, and if it is, it makes sure that the bottleneck() function is only invoked after acquiring a lock.
[[File:Nasal-gc.png|thumb|650px|Nasal GC]]


https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c#line99
https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c#line99
Line 367: Line 372:


The actual garbage collection takes place in [https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c#line114 line 114] where dead objects from the memory pool are freed, and the garbageCollect() function is called if globals.needGC is true.
The actual garbage collection takes place in [https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c#line114 line 114] where dead objects from the memory pool are freed, and the garbageCollect() function is called if globals.needGC is true.
[[File:Nasal-gc.png|thumb|550px|Nasal GC]]


= garbageCollect() =
= garbageCollect() =

Navigation menu