Opened 6 months ago

#1371 new defect

locative table is only grown, never shrunk

Reported by: sjamaan Owned by:
Priority: minor Milestone: 5.1
Component: core libraries Version: 4.12.0
Keywords: Cc:
Estimated difficulty: medium

Description

From a quick look at the code, it looks like we only realloc the locative_table when making a locative and the table is full. In extreme cases, this means the locative table will grow and never shrink back to a manageable size.

After some consideration, I think this is not a huge issue, as on every GC, collected locatives are thrown out of the table, so the maximum size of the locative table is bounded by the heap size. Still, this is not desirable.

I think the best place to do this is at the end of update_locative_table since we're already keeping track of the table size. We may also change this function to compact the table while walking it, so we can get by with a simple realloc().

Change History (0)

Note: See TracTickets for help on using tickets.