julia
cf9489b6 - flisp: Fix memory leaks

Commit
3 years ago
flisp: Fix memory leaks There's two independent issues here: 1. The table allocator assumes that small tables will be stored inline and do not need a finalizer. This is mostly true, except that hash collisions can cause premature growing of the inline table, so even for relatively small tables, we need to validate that the storage was not allocated out-of-line. 2. It is unsafe to clear the vtable finalizer pointer during the table allocation to supress the `add_finalizer` call. This is because the allocation of the table object itself may trigger GC of a different table, and without the finalizer set in the vtable, freeing of that table's memory space would get skipped.
Author
Committer
Parents
Loading