julia icon indicating copy to clipboard operation
julia copied to clipboard

flisp: Fix memory leaks

Open Keno opened this issue 3 years ago • 1 comments

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.

Keno avatar Aug 03 '22 23:08 Keno

Fixes #13540 ;)

Keno avatar Aug 05 '22 08:08 Keno