seize icon indicating copy to clipboard operation
seize copied to clipboard

Force flush of local buffer

Open ibraheemdev opened this issue 10 months ago • 1 comments
trafficstars

Currently, Guard::flush only succeeds if there are enough entries in the local buffer to be used as reclamation nodes for any active threads. In cases where there are high priority large objects, users may want to force flush the buffer even if there are not enough entries. We can expose Guard::force_flush that does this by allocating nodes on-demand to perform the reclamation, or potentially estimating the number of active threads and allocating a single buffer to serve as multiple nodes (though this seems tricky, and might be left for a future optimization). Though allocating to perform a flush sounds counterintuitive, this allocation will likely be very small compared to the memory that needs to be reclaimed, and is worth it if large objects are retired infrequently.

ibraheemdev avatar Jan 18 '25 02:01 ibraheemdev

https://github.com/ibraheemdev/seize/issues/33 should make this a lot cheaper.

ibraheemdev avatar Feb 09 '25 21:02 ibraheemdev