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

Example of hash map with GC cell as key and/or value #29

Open
ptomato opened this issue Jul 17, 2020 · 0 comments
Open

Example of hash map with GC cell as key and/or value #29

ptomato opened this issue Jul 17, 2020 · 0 comments

Comments

@ptomato
Copy link
Collaborator

ptomato commented Jul 17, 2020

Conversation starting here: https://chat.mozilla.org/#/room/#spidermonkey:mozilla.org/$YXBhZxFLHDHPc9pRp6Jz2-Vm9EDbzec0Rbeig_fPtJM

Especially:

sfink: Yes, a [GCHashMap<JS::Heap<JSString*>>] seems wrong to me if any of the string keys could be nursery strings.
DefaultHasher<JSString*> just uses the pointer
one option would be to hash and match on the string contents. We have a couple of instances of that in the tree. One for string deduplication, one for counting duplicate strings for about:memory.
tcampbell: what version did we turn on nursery strings?
this probably needs a good note and example in the examples repo..
sfink: [...] I was surprised that we make so little of strings as keys; there's not much prior art in the tree.
it looks nursery strings were Fx67, from bug 1442481

We should have an example of these sorts of hash maps using MovableCellHasher.

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

No branches or pull requests

1 participant