~smspillaz/folly/folly-git-master

Viewing all changes in revision 3882.

  • Committer: Facebook Github Bot
  • Author(s): Giuseppe Ottaviano
  • Date: 2017-05-24 06:04:53 UTC
  • Revision ID: git-v1:b1eb5b684447a4a58516d5e8ffbd328aab1e477d
A core-cached shared_ptr

Summary:
This class serves a similar use case to `ReadMostlySharedPtr`, but with two differences:

- It returns actual `shared_ptr`s, so it can be used as a drop-in replacement.
- Its memory utilization is constant, independent of the number of threads that use it.

Also, the code is much simpler. On the other hand, it is about 4x slower (but it still scales linearly in the number of concurrent threads acquiring the reference).

Reviewed By: djwatson

Differential Revision: D5104730

fbshipit-source-id: 8c18b635e0390394b06417b6df8b790e4bd2d90d

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: