How the Nasal GC works: Difference between revisions

Jump to navigation Jump to search
m
Line 247: Line 247:
== The pool manager ==
== The pool manager ==
All high level type allocators (naNewString, naNewVector, naNewHash etc) make use of the naNew() call introduced earlier.
All high level type allocators (naNewString, naNewVector, naNewHash etc) make use of the naNew() call introduced earlier.
naNew() doesn't directly allocate new memory from the heap, but instead use the naGC_get() helper which manages memory from the global pools.
naNew() doesn't directly allocate new memory from the heap, but instead use the naGC_get() helper which manages memory from the global pools (i.e. preallocated memory for each type).


The interesting part is the naGC_get() function which isn't directly mapped to naAlloc() or malloc(), but instead manages the Nasal memory pools.
The interesting part is the naGC_get() function which isn't directly mapped to naAlloc() or malloc(), but instead manages the Nasal memory pools.

Navigation menu