allocator
allocator copied to clipboard
improve dynamic load balancing
Storing the ID (address of tcache is fine) of the last thread to allocate from the arena would make it possible to force any other threads with that arena still assigned to migrate away.
There would be little reason to keep around the trylock() logic for detecting contention. It would only be useful as a way of detecting contention with threads releasing memory, and that doesn't indicate that they're assigned to the arena for allocation.