mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
RFE #1436243: make integers in [0..256] preallocated.
This commit is contained in:
parent
df431657fd
commit
418a1ef089
2 changed files with 5 additions and 1 deletions
|
|
@ -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
|
if float(1) == 1.0 and float(-1) == -1.0 and float(0) == 0.0: pass
|
||||||
else: raise TestFailed, 'float() does not work properly'
|
else: raise TestFailed, 'float() does not work properly'
|
||||||
print '6.4.1 32-bit integers'
|
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 != 36: raise TestFailed, 'int op'
|
||||||
if 12 + (-24) != -12: raise TestFailed, 'int op'
|
if 12 + (-24) != -12: raise TestFailed, 'int op'
|
||||||
if (-12) + 24 != 12: raise TestFailed, 'int op'
|
if (-12) + 24 != 12: raise TestFailed, 'int op'
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ fill_free_list(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NSMALLPOSINTS
|
#ifndef NSMALLPOSINTS
|
||||||
#define NSMALLPOSINTS 100
|
#define NSMALLPOSINTS 257
|
||||||
#endif
|
#endif
|
||||||
#ifndef NSMALLNEGINTS
|
#ifndef NSMALLNEGINTS
|
||||||
#define NSMALLNEGINTS 5
|
#define NSMALLNEGINTS 5
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue