Liste des Groupes | Revenir à cl c |
What is a good hash function for pointers to use in portable ANSI C?I kind of remember an old one for 32-bit pointers. It was something like multiply by a prime and shift to the right by 7 or 8. Shit, I think. It was way back on comp.programming.threads.
The pointers are nodes of a tree, which are read only, and I want to associate read/write data with them. So potentially a lage number of pointers,and they might be consecutively ordered if they are taken from an array, or they might be returned from repeared calls to malloc() with small allocations. Obviously I have no control over pointer size or internal representation.
Les messages affichés proviennent d'usenet.