hawkw / sharded-slab

a lock-free concurrent slab (experimental)
MIT License
269 stars 17 forks source link

Some way to query size of pool #54

Open rbtcollins opened 3 years ago

rbtcollins commented 3 years ago

Or size() or len() or capacity() or unused_len() or something

use case: we're using this to allocate disk buffers, and have to make sure we don't run out of memory; we can track how many items we have currently used in the pool, but there's no API I can see to query how many of these equal sized objects there are in the sharded pool that aren't currently used.

Or possibly better still... how many there just currently in the pool, whether in use, or pending use.