Differences From Artifact [df05949c71]:
- File
src/OFObject.m
— 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: 25822) [annotate] [blame] [check-ins using]
To Artifact [e989a30df6]:
- File src/OFObject.m — part of check-in [ac51f5f0cf] at 2012-12-06 00:14:47 on branch trunk — Improve -[hash] of OFNumber and OFObject. (user: js, size: 25972) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
840 841 842 843 844 845 846 | /* Classes containing data should reimplement this! */ return (self == object); } - (uint32_t)hash { /* Classes containing data should reimplement this! */ | > | > > > > > > > > > > > > > | 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 | /* Classes containing data should reimplement this! */ return (self == object); } - (uint32_t)hash { /* Classes containing data should reimplement this! */ uintptr_t ptr = (uintptr_t)self; uint32_t hash; OF_HASH_INIT(hash); while (ptr != 0) { OF_HASH_ADD(hash, ptr & 0xFF); ptr <<= 8; } OF_HASH_FINALIZE(hash); return hash; } - (OFString*)description { /* Classes containing data should reimplement this! */ return [OFString stringWithFormat: @"<%@: %p>", [self className], self]; } - (void*)allocMemoryWithSize: (size_t)size { void *pointer; struct pre_mem *preMem; |
︙ | ︙ |