| 1 |
#ifndef Py_INTERNAL_GLOBAL_OBJECTS_H |
| 2 |
#define Py_INTERNAL_GLOBAL_OBJECTS_H |
| 3 |
#ifdef __cplusplus |
| 4 |
extern "C" { |
| 5 |
#endif |
| 6 |
|
| 7 |
#ifndef Py_BUILD_CORE |
| 8 |
# error "this header requires Py_BUILD_CORE define" |
| 9 |
#endif |
| 10 |
|
| 11 |
|
| 12 |
// Only immutable objects should be considered runtime-global. |
| 13 |
// All others must be per-interpreter. |
| 14 |
|
| 15 |
#define _Py_GLOBAL_OBJECT(NAME) \ |
| 16 |
_PyRuntime.static_objects.NAME |
| 17 |
#define _Py_SINGLETON(NAME) \ |
| 18 |
_Py_GLOBAL_OBJECT(singletons.NAME) |
| 19 |
|
| 20 |
|
| 21 |
#define _Py_INTERP_CACHED_OBJECT(interp, NAME) \ |
| 22 |
(interp)->cached_objects.NAME |
| 23 |
|
| 24 |
|
| 25 |
#define _Py_INTERP_STATIC_OBJECT(interp, NAME) \ |
| 26 |
(interp)->static_objects.NAME |
| 27 |
#define _Py_INTERP_SINGLETON(interp, NAME) \ |
| 28 |
_Py_INTERP_STATIC_OBJECT(interp, singletons.NAME) |
| 29 |
|
| 30 |
|
| 31 |
#ifdef __cplusplus |
| 32 |
} |
| 33 |
#endif |
| 34 |
#endif /* !Py_INTERNAL_GLOBAL_OBJECTS_H */ |