#void, void arraymaps

1 messages · Page 1 of 1 (latest)

crimson pier
#

Does anyone have an article or even brief description of how void, void arrayhashmaps work in internpool?

I kinda get the intent but I'm having trouble visualizing what's happening. What gets stored in the hashmap (if anything) or is it just an API for a linear probe?

And, how does an array map change things? (I'm not completely sure how array maps differ in general from regular hashtables, trying to read through source code now).

I do understand how hashtables work, and how void values (sets) work.

Thanks!

languid quarry
#

as you already said, a void value just makes it a set
a HashMap is unordered, so it maps keys to values, and using a void key is meaningless as it can only contain one possible key
however an ArrayHashMap is ordered, so it maps keys to indices into an array of keys and values, so using a void key means that the mapping is kept but the keys are already stored externally and so nothing needs to be stored internally in the array

lavish zodiac
#

so is it computing the hashes and comparing hashes based on the real key from a given index? how are you calling .getOrPutAdapted on the hashmap with a key type that isn't void?