Liste des Groupes | Revenir à cl c |
On 25/05/2024 22:13, Janis Papanagnou wrote:
OK, parsing is a task I'm familiar with. Parsing a normal language into a syntax tree doesn't sound too different from parsing XML into a tree of nodes.I haven't read all the thread, but if I'd be going to tackle thatYes, the Baby X resource compiler should be portable to any hosted platform with a reasonable up to date C compiler.
I'd first try to map the pointer onto a fitting integral type (if
that's possible; sizeof()), or first "fold" (XOR) the upper/lower
parts of the pointer (so that zero-sequences, if they appear, also
won't affect the outcome too badly as a side effect) to reduce the
size of the data, and finally use any established hash algorithm
on the (folded/reduced) integral type.
>
Shall the created hash codes also be portable across platforms?
>
But we also need portablity in another sense. The hash table is hashing nodes of a XML document model created by the functions in the file xmlparser2.c. These make repeated calls to malloc() for small allocations of nodes. But I have no control, over either pointer representation or the platform's implemetation of malloc(). So the pointers could be at seemingly rsndom loctions in. memory, or they could be evenly spaced at increments of 64 bytes, and thus differing in only a few bits.
Les messages affichés proviennent d'usenet.