Created
June 6, 2016 17:00
-
-
Save pzp1997/5d7f788bb0f3006d9228e557b7197fba to your computer and use it in GitHub Desktop.
Excerpt from source code for Python int objects about caching "small" int values.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef NSMALLPOSINTS | |
#define NSMALLPOSINTS 257 | |
#endif | |
#ifndef NSMALLNEGINTS | |
#define NSMALLNEGINTS 5 | |
#endif | |
#if NSMALLNEGINTS + NSMALLPOSINTS > 0 | |
/* References to small integers are saved in this array so that they | |
can be shared. | |
The integers that are saved are those in the range | |
-NSMALLNEGINTS (inclusive) to NSMALLPOSINTS (not inclusive). | |
*/ | |
static PyIntObject *small_ints[NSMALLNEGINTS + NSMALLPOSINTS]; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment