shared_ptr
shared_ptr
https://github.com/microsoft/STL/blob/main/stl/inc/memory
생성자에서 해당 함수 호출
shared_ptr 은 _Ptr _base 상속 받아서 사용
_Ptr_base 클래스는 다음 멤버변수를 들고있다.
_Ref_count_base 값은 그냥 단순 변수 두개를 들고있다.
counting이 intelock계열을 이용해 atomic 하게 작동하는 함수임을 알 수 있다.
_Ref_count가 실제로 사용.
ptr을 추가로 가지고 있음.
전체 도식화
Posted 2024-03-24