[Python-checkins] CVS: python/dist/src/PC _winreg.c,1.4,1.5
Fred L. Drake
python-dev@python.org
2000年6月29日 12:17:07 -0700
- Previous message: [Python-checkins] CVS: python/dist/src/Objects methodobject.c,2.26,2.27 object.c,2.73,2.74 floatobject.c,2.57,2.58 complexobject.c,2.24,2.25 classobject.c,2.91,2.92 funcobject.c,2.22,2.23
- Next message: [Python-checkins] CVS: python/dist/src/Lib/test test_hash.py,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/PC
In directory slayer.i.sourceforge.net:/tmp/cvs-serv3837/PC
Modified Files:
_winreg.c
Log Message:
This patch addresses two main issues: (1) There exist some non-fatal
errors in some of the hash algorithms. For exmaple, in float_hash and
complex_hash a certain part of the value is not included in the hash
calculation. See Tim's, Guido's, and my discussion of this on
python-dev in May under the title "fix float_hash and complex_hash for
64-bit *nix"
(2) The hash algorithms that use pointers (e.g. func_hash, code_hash)
are universally not correct on Win64 (they assume that sizeof(long) ==
sizeof(void*))
As well, this patch significantly cleans up the hash code. It adds the
two function _Py_HashDouble and _PyHash_VoidPtr that the various
hashing routine are changed to use.
These help maintain the hash function invariant: (a==b) =>
(hash(a)==hash(b))) I have added Lib/test/test_hash.py and
Lib/test/output/test_hash to test this for some cases.
Index: _winreg.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/PC/_winreg.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** _winreg.c 2000年06月29日 16:14:14 1.4
--- _winreg.c 2000年06月29日 19:17:04 1.5
***************
*** 424,428 ****
XXX - should we use the handle value?
*/
! return (long)ob;
}
--- 424,428 ----
XXX - should we use the handle value?
*/
! return _Py_HashPointer(ob);
}
- Previous message: [Python-checkins] CVS: python/dist/src/Objects methodobject.c,2.26,2.27 object.c,2.73,2.74 floatobject.c,2.57,2.58 complexobject.c,2.24,2.25 classobject.c,2.91,2.92 funcobject.c,2.22,2.23
- Next message: [Python-checkins] CVS: python/dist/src/Lib/test test_hash.py,NONE,1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]