Skip to content

Instantly share code, notes, and snippets.

@anossov
Created January 30, 2014 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anossov/8707420 to your computer and use it in GitHub Desktop.
Save anossov/8707420 to your computer and use it in GitHub Desktop.
cPython small integers
#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];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment