Bug #19029
closedMoving a transient heap allocated array between size pools can trigger GC while in GC
Description
RARRAY_PTR when called with a transient array detransients the array before returning its pointer which allocates in the heap.
Because RARRAY_PTR was being used during compaction (when re-embedding arrays that have moved between size pools) this introduces the possibility that we can hit a malloc threshold, triggering GC, while in the middle of compaction.
We should avoid this by using safer functions to get hold of the pointer. Since we know that the array is not embedded here, we can use ARY_HEAP_PTR and ARY_EMBED_PTR directly
Updated by eightbitraptor (Matt V-H) over 2 years ago
- Status changed from Open to Closed
Applied in changeset git|892f350a7db4d2cc99c5061d2e74498dfc4809ca.
[Bug #19029] Don't start GC during compaction
RARRAY_PTR when called with a transient array detransients the array
before returning its pointer which allocates in the heap.
Because RARRAY_PTR was being used during compaction (when re-embedding
arrays that have moved between size pools) this introduces the
possibility that we can hit a malloc threshold, triggering GC, while in
the middle of compaction.
We should avoid this by using safer functions to get hold of the
pointer. Since we know that the array is not embedded here, we can use
ARY_HEAP_PTR and ARY_EMBED_PTR directly