Hash considerations #50
d-m-bailey
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
#define OBJHASHSIZE 42073
. Leads to performance issues in larger chips. Proposal: allow hash resizing.HashIntPtrInstall
andHashIntPtrLookup
use(*matchintfunc)(name, np->name, value, (int)(*((int *)np->ptr)))
wherevalue
is a file number.(int)(*((int *)np->ptr)))
is the first 32 bits of whatever is at the address stored innp->ptr
, correct? I don't see how that would match a file number (unless they're both zero). Proposal: Change toHashInt2PtrInstall
andHashInt2PtrLookup
.HashInt2PtrInstall
andHashInt2PtrLookup
usegenhash
to generate the key, which is not case insensitive. Although the hash does contain the integerc
, it is possible that creating the key via modulo would give the same key for the same name and 2 different int values. The hash origin comparison does not include a check for the integer, so the wrong value may be returned. Proposal: Save int in the hash list for comparison. Create case insensitive comparison, if needed.(hash & (2^n-1))
Beta Was this translation helpful? Give feedback.
All reactions