After encountering the shortcomings of memory allocator in heavily multithreaded apps, I have implemented a new one (already 5th .
There are two advantages:
- allocator is non-locking for in-thread allocations, only remote-free locks
- false sharing - cacheline contention - is no more a problem.
Moreover, surprisingly it is a bit faster in single-threaded apps too.
However, this is a very fragile piece of code (took me 7 days to develop those 800 lines), I have tested it in a test with one bilion allocations; anyway if you have any mission critical software, I recommend to backup Core to your app nest (so that older version will be used) (and wait a week or two
May be this could be handy, or it will be interesting to compare - just pasting link.
Well, at first glance it seems to me that TCMalloc just does too much Certainly, they are not using our main trick - keeping management data at the beginning of small-block 4KB page...