20,741
edits
m (→Pool storage) |
m (→Pool storage) |
||
| Line 5: | Line 5: | ||
= Pool storage = | = Pool storage = | ||
A memory pool is basically a preallocated region of memory. The Nasal GC works such that it manages a handful of global memory pools for all native Nasal types (strings, functions, vectors, hashes etc). | A memory pool is basically a preallocated region of memory. The Nasal GC works such that it manages a handful of global memory pools for all native Nasal types (strings, functions, vectors, hashes etc). | ||
Whenever new memory is requested to create a new type (such as a vector or a string), the available memory in the corresponding pool will be checked, dead objects will be removed from all pools, | |||
Whenever new memory is requested to create a new type (such as a vector or a string), the available memory in the corresponding pool will be checked, reachable objects will be marked, and dead objects will be removed from all pools using a mark/sweep collector, new memory blocks will be allocated if necessary. All of this happens atomically, i.e. single-threaded. | |||
== Memory blocks == | == Memory blocks == | ||