after discussion with ciruZ, switch mksh from NZAT to NZAAT fully
to get rid of the bias introduced by making the hash never zero … he also pointed out a memory (heap) usage optimisation… which may impact code size a bit though as I’d need to pass an additional argument on hashtable function calls… or, forgo the benefit of not having to pointer-align the key in the structure, which can be as much as 3/7 octets per item, heap storage… OTOH the saved space is 4/8 octets per not-allocated item, possibly some code (use of an multiply-add opcode), but the function call overhead/cost would possibly be quite a bit… I guess I’ll have to measure…
This commit is contained in:
4
var.c
4
var.c
@ -27,7 +27,7 @@
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.146 2012/04/14 14:35:13 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.147 2012/04/22 21:50:35 tg Exp $");
|
||||
|
||||
/*-
|
||||
* Variables
|
||||
@ -1471,7 +1471,7 @@ hash(const void *s)
|
||||
|
||||
NZATInit(h);
|
||||
NZATUpdateString(h, s);
|
||||
NZATFinish(h);
|
||||
NZAATFinish(h);
|
||||
return (h);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user