Add Map type, add hashbrown crate dependency

We should have a preliminary implementation of maps going right now.
Thus far we have:

* Map.insert
* Map.__index__
* Map.remove

And some other minor functions. The big news with this is the couple of
pretty hot `unsafe` calls that borrow the VM mutably in two different
closures, simultaneously. This should be safe since these two different
closures aren't being called at the same time, somehow. Maybe one could
be calling the other. But that's not happening (I checked).

This also adds the hashbrown crate to handle the actual hashtable
implementation, so we don't have to implement our own hashtables.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2024-10-14 19:05:27 -07:00
parent c6e242c39d
commit 4cdc48537c
9 changed files with 563 additions and 14 deletions

View File

@@ -9,3 +9,4 @@ clap = { version = "4.5.8", features = ["derive"] }
common_macros = "0.1.1"
thiserror = "1.0.63"
gc = { version = "0.5", features = ["derive"] }
hashbrown = "0.15.0"