]> granicus.if.org Git - python/commitdiff
RFE #1436243: make integers in [0..256] preallocated.
authorGeorg Brandl <georg@python.org>
Wed, 22 Feb 2006 11:30:06 +0000 (11:30 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 22 Feb 2006 11:30:06 +0000 (11:30 +0000)
Lib/test/test_types.py
Objects/intobject.c

index 4abc7caafb3473d93d3607e21f90c9e0411b650e..c575c0c931794cf2ac6e5dd0a436488249d3a24f 100644 (file)
@@ -90,6 +90,10 @@ else: raise TestFailed, 'long() does not round properly'
 if float(1) == 1.0 and float(-1) == -1.0 and float(0) == 0.0: pass
 else: raise TestFailed, 'float() does not work properly'
 print '6.4.1 32-bit integers'
+# Ensure the first 256 integers are shared
+a = 256
+b = 128*2
+if a is not b: raise TestFailed, '256 is not shared'
 if 12 + 24 != 36: raise TestFailed, 'int op'
 if 12 + (-24) != -12: raise TestFailed, 'int op'
 if (-12) + 24 != 12: raise TestFailed, 'int op'
index 232b2d234a5ee10da2e8a485ef20ebca00f774e5..352210c81901e0cd4c9f1edc9cef5861f5853b0f 100644 (file)
@@ -62,7 +62,7 @@ fill_free_list(void)
 }
 
 #ifndef NSMALLPOSINTS
-#define NSMALLPOSINTS          100
+#define NSMALLPOSINTS          257
 #endif
 #ifndef NSMALLNEGINTS
 #define NSMALLNEGINTS          5