Commit Graph

11 Commits

Author SHA1 Message Date
0561d951d4 Finish std::shared_ptr -> Ref migration 2025-09-11 15:06:04 -04:00
a2da7fba84 Explicitly support having a WeakRef to self 2025-09-11 14:54:42 -04:00
5d932bf36c Add polymorphism support to Ref 2025-09-11 14:15:52 -04:00
9a8d4feedd Add documentation 2025-09-11 13:54:00 -04:00
9cd83fc426 Call ~ControlBlock
It's trivially destructible, but just in case. Compiler should optimize it out
2025-09-11 13:18:19 -04:00
10e382f633 Used biased weak count, cache T* pointer
Logically, the strong pointer that destroys T owns +1 weak count too
2025-09-11 13:15:03 -04:00
994e31032f Fix data race in freeing control block 2025-09-11 11:32:59 -04:00
0f179eed88 Switch to two separate atomic counters
It's faster and still correct. I was confused remembering something
about atomic shared pointer ideas before.
2025-09-11 10:53:25 -04:00
b9106a0d3c Add test_reference.cpp 2025-09-10 22:05:31 -04:00
6aaca4c171 Finish reference.hpp 2025-09-10 21:58:08 -04:00
7c4d928807 Start on Ref/WeakRef 2025-09-10 20:04:32 -04:00