Differences From Artifact [f956fa931a]:
- File
src/macros.h
— part of check-in
[120caad331]
at
2012-11-30 16:09:39
on branch trunk
— Make runtime API more similar to Apple's.
This makes it easier to use runtime functions in portable code. (user: js, size: 8869) [annotate] [blame] [check-ins using]
To Artifact [419a2f32d2]:
- File
src/macros.h
— part of check-in
[f60e4012b7]
at
2012-12-04 09:19:58
on branch trunk
— Randomize hashes.
This prevents DoSing hashtables by creating conflicts deliberately. (user: js, size: 8880) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
322 323 324 325 326 327 328 | # define OF_IOS #endif #define OF_ROL(value, bits) \ (((value) << ((bits) % (sizeof(value) * 8))) | \ (value) >> (sizeof(value) * 8 - ((bits) % (sizeof(value) * 8)))) | | | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | # define OF_IOS #endif #define OF_ROL(value, bits) \ (((value) << ((bits) % (sizeof(value) * 8))) | \ (value) >> (sizeof(value) * 8 - ((bits) % (sizeof(value) * 8)))) #define OF_HASH_INIT(hash) hash = of_hash_seed #define OF_HASH_ADD(hash, byte) \ { \ hash += (uint8_t)byte; \ hash += (hash << 10); \ hash ^= (hash >> 6); \ } #define OF_HASH_FINALIZE(hash) \ |
︙ | ︙ |