On Mon Oct 16 14:34:36 2023 +0000, Conor McCarthy wrote:
I looked at this during development. When an object is freed it must be marked as free within its `REBALANCE_SIZE` packet, and the only way to make that object available for reuse is to add the packet to the cache. So we end up adding packets containing only one free object. But we can't send packets to the rebalancing array unless they are completely free, otherwise multiple threads can allocate and free objects within the same packet, and we are back to square one. It may be slightly advantageous to transfer more than `REBALANCE_SIZE` because of cache coherence and the overhead of mutex locking/unlocking. Do you see any other advantages?
I wouldn't say arbitrarily large. It grows only if its current size proved insufficient to fill the client's demands, so it can't grow larger than the maximum descriptor allocation made by the client. If the client does silly things with threads, many threads could have a large allocation, but the total is unlikely to grow exceptionally large.