/usr/include/python3.10
NameSizeModeActions
cpython/-0755rm
internal/-0755rm
abstract.h314050644editdlrm
bltinmodule.h2640644editdlrm
boolobject.h12240644editdlrm
bytearrayobject.h14840644editdlrm
bytesobject.h25930644editdlrm
cellobject.h7200644editdlrm
ceval.h57030644editdlrm
classobject.h16570644editdlrm
code.h3180644editdlrm
codecs.h70710644editdlrm
compile.h5200644editdlrm
complexobject.h18060644editdlrm
context.h19620644editdlrm
datetime.h96350644editdlrm
descrobject.h30020644editdlrm
dictobject.h38530644editdlrm
dynamic_annotations.h224710644editdlrm
enumobject.h2530644editdlrm
errcode.h17000644editdlrm
eval.h8310644editdlrm
exports.h10980644editdlrm
fileobject.h15710644editdlrm
fileutils.h5080644editdlrm
floatobject.h43600644editdlrm
frameobject.h3370644editdlrm
funcobject.h42570644editdlrm
genericaliasobject.h3340644editdlrm
genobject.h33470644editdlrm
graminit.h00644editdlrm
import.h30260644editdlrm
interpreteridobject.h3340644editdlrm
intrcheck.h7720644editdlrm
iterobject.h5930644editdlrm
listobject.h17810644editdlrm
longintrepr.h37990644editdlrm
longobject.h86060644editdlrm
marshal.h8030644editdlrm
memoryobject.h27640644editdlrm
methodobject.h41470644editdlrm
modsupport.h103330644editdlrm
moduleobject.h24580644editdlrm
namespaceobject.h3490644editdlrm
object.h283440644editdlrm
objimpl.h84450644editdlrm
opcode.h55090644editdlrm
osdefs.h7370644editdlrm
osmodule.h2910644editdlrm
patchlevel.h13010644editdlrm
pycapsule.h17250644editdlrm
pyconfig.h41590644editdlrm
pydtrace.h24130644editdlrm
pyerrors.h124260644editdlrm
pyexpat.h24500644editdlrm
pyframe.h4660644editdlrm
pyhash.h42230644editdlrm
pylifecycle.h20800644editdlrm
pymacconfig.h29890644editdlrm
pymacro.h49200644editdlrm
pymath.h83130644editdlrm
pymem.h38910644editdlrm
pyport.h316840644editdlrm
pystate.h52500644editdlrm
pystrcmp.h4360644editdlrm
pystrhex.h8490644editdlrm
pystrtod.h14830644editdlrm
Python.h32240644editdlrm
pythonrun.h11100644editdlrm
pythread.h59890644editdlrm
py_curses.h24740644editdlrm
rangeobject.h6280644editdlrm
setobject.h33810644editdlrm
sliceobject.h25160644editdlrm
structmember.h20740644editdlrm
structseq.h13900644editdlrm
sysmodule.h12420644editdlrm
token.h26690644editdlrm
traceback.h5840644editdlrm
tracemalloc.h11140644editdlrm
tupleobject.h16140644editdlrm
typeslots.h24600644editdlrm
unicodeobject.h361480644editdlrm
warnings.h17760644editdlrm
weakrefobject.h28630644editdlrm
Edit: /usr/include/python3.10/pymem.h (3891B)
/* The PyMem_ family: low-level memory allocation interfaces. See objimpl.h for the PyObject_ memory family. */ #ifndef Py_PYMEM_H #define Py_PYMEM_H #include "pyport.h" #ifdef __cplusplus extern "C" { #endif /* BEWARE: Each interface exports both functions and macros. Extension modules should use the functions, to ensure binary compatibility across Python versions. Because the Python implementation is free to change internal details, and the macros may (or may not) expose details for speed, if you do use the macros you must recompile your extensions with each Python release. Never mix calls to PyMem_ with calls to the platform malloc/realloc/ calloc/free. For example, on Windows different DLLs may end up using different heaps, and if you use PyMem_Malloc you'll get the memory from the heap used by the Python DLL; it could be a disaster if you free()'ed that directly in your own extension. Using PyMem_Free instead ensures Python can return the memory to the proper heap. As another example, in a debug build (Py_DEBUG macro), Python wraps all calls to all PyMem_ and PyObject_ memory functions in special debugging wrappers that add additional debugging info to dynamic memory blocks. The system routines have no idea what to do with that stuff, and the Python wrappers have no idea what to do with raw blocks obtained directly by the system routines then. The GIL must be held when using these APIs. */ /* * Raw memory interface * ==================== */ /* Functions Functions supplying platform-independent semantics for malloc/realloc/ free. These functions make sure that allocating 0 bytes returns a distinct non-NULL pointer (whenever possible -- if we're flat out of memory, NULL may be returned), even if the platform malloc and realloc don't. Returned pointers must be checked for NULL explicitly. No action is performed on failure (no exception is set, no warning is printed, etc). */ PyAPI_FUNC(void *) PyMem_Malloc(size_t size); PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); PyAPI_FUNC(void *) PyMem_Realloc(void *ptr, size_t new_size); PyAPI_FUNC(void) PyMem_Free(void *ptr); /* * Type-oriented memory interface * ============================== * * Allocate memory for n objects of the given type. Returns a new pointer * or NULL if the request was too large or memory allocation failed. Use * these macros rather than doing the multiplication yourself so that proper * overflow checking is always done. */ #define PyMem_New(type, n) \ ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ ( (type *) PyMem_Malloc((n) * sizeof(type)) ) ) /* * The value of (p) is always clobbered by this macro regardless of success. * The caller MUST check if (p) is NULL afterwards and deal with the memory * error if so. This means the original value of (p) MUST be saved for the * caller's memory error handler to not lose track of it. */ #define PyMem_Resize(p, type, n) \ ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \ (type *) PyMem_Realloc((p), (n) * sizeof(type)) ) // Deprecated aliases only kept for backward compatibility. // PyMem_Del and PyMem_DEL are defined with no parameter to be able to use // them as function pointers (ex: dealloc = PyMem_Del). #define PyMem_MALLOC(n) PyMem_Malloc(n) #define PyMem_NEW(type, n) PyMem_New(type, n) #define PyMem_REALLOC(p, n) PyMem_Realloc(p, n) #define PyMem_RESIZE(p, type, n) PyMem_Resize(p, type, n) #define PyMem_FREE(p) PyMem_Free(p) #define PyMem_Del PyMem_Free #define PyMem_DEL PyMem_Free #ifndef Py_LIMITED_API # define Py_CPYTHON_PYMEM_H # include "cpython/pymem.h" # undef Py_CPYTHON_PYMEM_H #endif #ifdef __cplusplus } #endif #endif /* !Py_PYMEM_H */