Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the container of values to be either Rc, Arc, or owned. #36

Open
9 tasks
orium opened this issue Jul 8, 2018 · 2 comments
Open
9 tasks

Allow the container of values to be either Rc, Arc, or owned. #36

orium opened this issue Jul 8, 2018 · 2 comments

Comments

@orium
Copy link
Owner

orium commented Jul 8, 2018

  • List
  • Stack
  • Queue
  • Vector
  • HashTrieMap
  • HashTrieSet
  • RedBlackTreeMap
  • RedBlackTreeSet
  • Add info to the README.md and maybe to the documentation of the data structures.

Ref #22, #7.

@carado
Copy link

carado commented Aug 12, 2019

Hi ! In the interest of performance, it would also be nice to support servo_arc as an optional feature.

In the unlikely case you don't know about it, the hamt crate has a nice way of being generic over type-of-ownership, in a way that makes it easily extendable to custom ownership types such as servo_arc::Arc, or anything a user would implement; it only requires HamtRef: Clone + Deref<Target = Hamt<K, V, HamtRef>> + From<Hamt<K, V, HamtRef>> (see https://docs.rs/hamt/0.2.0/hamt/enum.Hamt.html).

@orium
Copy link
Owner Author

orium commented Aug 13, 2019

Hi @carado. Yes, supporting servo_arc seems like a good idea.

The strategy hamt is using to abstract from the pointer type works fine for its specific case, but becomes really unergonomic on other use cases (in particular when you want to use wrap different types on the shared pointer). Because of this I wrote archery to solve that, and I'm currently porting rpds to it.

One big limitation or archery is that it doesn't (easily) allow for users to create their own shared pointer types. I think this should be solvable, and I plan to explore that in the next version of archery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants