News for hackers. Stuff that matters.
Re:Writing a Memory Allocator (2019) by praptak on Sunday December 13, 2020 @02:41AM (#25404991)
That's not the point at all. Having a per-thread pool means synchronization-free alloc.

What happens with the object afterwards is not relevant.

Re:Writing a Memory Allocator (2019) by fh973 on Sunday December 13, 2020 @02:45AM (#25405001)
But objects are passed around between threads and another thread might want to free it?
Re:Writing a Memory Allocator (2019) by praptak on Sunday December 13, 2020 @02:48AM (#25405014)
Then it goes to the freeing thread memory pool. Thread-aware mallocs know this and have clever balancing mechanisms for situations like producer-consumer, where one thread allocs a lot and another frees a lot.

Edit: wrong, I re-checked. The solution to this is that marking an object as free is lock-free. The freed objects do not immediately change thread pools.