[Python-checkins] commit of r41906 - python/branches/ssize_t/Objects/obmalloc.c

martin.v.loewis python-checkins at python.org
Tue Jan 3 14:16:55 CET 2006


Author: martin.v.loewis
Date: Tue Jan  3 14:16:53 2006
New Revision: 41906

Modified:
   python/branches/ssize_t/Objects/obmalloc.c
Log:
Disable 32-bit size limitation for 64-bit mode.


Modified: python/branches/ssize_t/Objects/obmalloc.c
==============================================================================
--- python/branches/ssize_t/Objects/obmalloc.c	(original)
+++ python/branches/ssize_t/Objects/obmalloc.c	Tue Jan  3 14:16:53 2006
@@ -1005,6 +1005,8 @@
 
 	bumpserialno();
 	total = nbytes + 16;
+#if SIZEOF_SIZE_T < 8
+	/* XXX do this check only on 32-bit machines */
 	if (total < nbytes || (total >> 31) > 1) {
 		/* overflow, or we can't represent it in 4 bytes */
 		/* Obscure:  can't do (total >> 32) != 0 instead, because
@@ -1013,6 +1015,7 @@
 		   size_t is an unsigned type. */
 		return NULL;
 	}
+#endif
 
 	p = (uchar *)PyObject_Malloc(total);
 	if (p == NULL)


More information about the Python-checkins mailing list