Add integrated reference counting
authorMaged Michael <magedmichael@fb.com>
Wed, 1 Nov 2017 14:47:41 +0000 (07:47 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 1 Nov 2017 14:49:55 +0000 (07:49 -0700)
commit571e7b975c152ee41027262224a25ade1fb637aa
tree8c8f1ea69c912dcae70619c8dbc2e5939e068f15
parent3ace27b880a04f03b564f94f367a4ff5419792f2
Add integrated reference counting

Summary:
Add support for reference counting integrated with the internal structures and operations of the hazard pointer library. The operations are wait-free.
The advantages of this approach over combining reference counting with hazard pointers externally are:
(1) A long list of linked objects that protected by one reference can all be reclaimed together instead of going through a potentially long series of alternating reclamation and calls to retire() for descendants.
(2) Support for iterative deletion as opposed to potential deep recursion of alternating calls to release reference count and object destructors.

Reviewed By: djwatson

Differential Revision: D6142066

fbshipit-source-id: 02bdfcbd5a2c2d5486d937bb2f9cfb6f192f5e1a
folly/experimental/hazptr/hazptr-impl.h
folly/experimental/hazptr/hazptr.h
folly/experimental/hazptr/test/HazptrTest.cpp