Hi Wojtek!
There is no out-of-the-box solution for this... but a few hints:
1) if your keys don't override equals/ hashCode then the default
implementation in Object is effectively an identity comparison anyway
and you can just use Object*OpenHashMap(s).
2) you can obviously implement a wrapper implementing equals/ hashCode
as an identity of the provided delegate, but this defeats the purpose
I guess (conserving some memory).
3) you could copy/ paste the code of KTypeVTypeOpenHashMap.java and
generate an identity-key-map for generic types by replacing:
Intrinsics.equalsKType(a, b)
with a conditional that would generate (for object KType):
(a) == (b)
and probably it'd be also better to use System.identityHashCode in
place for rehash(..). Now that I think of it it may not be as trivial
as I initially thought and some fundamental knowledge of the
templating system would be probably needed. I will look into this.
4) Can you explain a bit what type of map do you need? Does it require
deletions? Is the maximum number of unique keys known in advance? I
ask because such a map is actually pretty trivial to write (assuming
linear probing); perhaps I can offer some assistance here.
Dawid
> --
> You received this message because you are subscribed to the Google Groups
> "High Performance Primitive Collections for Java" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
>
java-high-performance-primi...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.