determine length of chains in hashtable buckets

  • Thread starter Thread starter leotohill
  • Start date Start date
L

leotohill

I'd like to analyze some populated hashtables to determine the length
of synonym chains in the buckets. However, I haven't been able to get
to the necessary properties using reflection. I can see them in the
debugger, though. Is there a way to get to those properties
programmatically, that is available to me?

for example, what I can see in the debugger is myhashtable/raw
view/non-public members/buckets

?
 
I would probably implement my own hashtable if I were doing such things as I
could build some domain knowledge into it.

As for how to get them you can quite simply get them using reflections just
remember to include privates in your search.

Cheers,

Greg
 
It is a bit involved but you could grab each element in the table, and find
its hash value
then work backwards to see how many different elements had the same hash,
messy but it might do what you want

hth

guy
 
I tried that, couldn't get it to work. I thought that they were hidden
from me. Isn't it possible to mark fields/properties as inaccessable
via reflection?

But maybe I messed up. I'll try again...
 
I tried that, couldn't get it to work. I thought that they were hidden
from me. Isn't it possible to mark fields/properties as inaccessable
via reflection?

But maybe I messed up. I'll try again...

No, if you're running in a full trust environment, you'll have full
access to the fields, so long as you specify that you want non-public
ones as well.
 
Back
Top