snazzy-d / sdc

The Snazzy D Compiler
MIT License
249 stars 55 forks source link

Resize large GC allocs in place whenever possible. #265

Closed deadalnix closed 1 year ago

deadalnix commented 1 year ago

Right now, if large allocation require a change in the number of pages that they use, it always results in a new allocation. It would be beneficial to be able to reallocate "in place".

Relevant code: https://github.com/snazzy-d/sdc/blob/master/sdlib/d/gc/tcache.d#L86-L88

This is pretty much self explanatory. The current behavior clearly is sub-optimal.