Herb Sutter pointed out the need to add a tracked pointer to C++. He proposed the concept of deferred_ptr a few years ago. I implemented the tracked_ptr concept with one tracked heap. Advantages:
- Thread safe
- Does not use reference counters
- Easy to use like shared_ptr
- Less memory overhead than shared_ptr
- Faster than shared_ptr in many scenarios
- Automatic roots registration
- Never stop the world
- Cyclic data structures friendly
- CoW friendly
- Executing destructors in a separate thread
- Atomic pointers always lock-free
- Only one header file
1 comment
[ 2.7 ms ] story [ 14.4 ms ] thread