Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/python3....
File: pyarena.h
/* An arena-like memory interface for the compiler.
[0] Fix | Delete
*/
[1] Fix | Delete
[2] Fix | Delete
#ifndef Py_LIMITED_API
[3] Fix | Delete
#ifndef Py_PYARENA_H
[4] Fix | Delete
#define Py_PYARENA_H
[5] Fix | Delete
[6] Fix | Delete
#ifdef __cplusplus
[7] Fix | Delete
extern "C" {
[8] Fix | Delete
#endif
[9] Fix | Delete
[10] Fix | Delete
typedef struct _arena PyArena;
[11] Fix | Delete
[12] Fix | Delete
/* PyArena_New() and PyArena_Free() create a new arena and free it,
[13] Fix | Delete
respectively. Once an arena has been created, it can be used
[14] Fix | Delete
to allocate memory via PyArena_Malloc(). Pointers to PyObject can
[15] Fix | Delete
also be registered with the arena via PyArena_AddPyObject(), and the
[16] Fix | Delete
arena will ensure that the PyObjects stay alive at least until
[17] Fix | Delete
PyArena_Free() is called. When an arena is freed, all the memory it
[18] Fix | Delete
allocated is freed, the arena releases internal references to registered
[19] Fix | Delete
PyObject*, and none of its pointers are valid.
[20] Fix | Delete
XXX (tim) What does "none of its pointers are valid" mean? Does it
[21] Fix | Delete
XXX mean that pointers previously obtained via PyArena_Malloc() are
[22] Fix | Delete
XXX no longer valid? (That's clearly true, but not sure that's what
[23] Fix | Delete
XXX the text is trying to say.)
[24] Fix | Delete
[25] Fix | Delete
PyArena_New() returns an arena pointer. On error, it
[26] Fix | Delete
returns a negative number and sets an exception.
[27] Fix | Delete
XXX (tim): Not true. On error, PyArena_New() actually returns NULL,
[28] Fix | Delete
XXX and looks like it may or may not set an exception (e.g., if the
[29] Fix | Delete
XXX internal PyList_New(0) returns NULL, PyArena_New() passes that on
[30] Fix | Delete
XXX and an exception is set; OTOH, if the internal
[31] Fix | Delete
XXX block_new(DEFAULT_BLOCK_SIZE) returns NULL, that's passed on but
[32] Fix | Delete
XXX an exception is not set in that case).
[33] Fix | Delete
*/
[34] Fix | Delete
PyAPI_FUNC(PyArena *) PyArena_New(void);
[35] Fix | Delete
PyAPI_FUNC(void) PyArena_Free(PyArena *);
[36] Fix | Delete
[37] Fix | Delete
/* Mostly like malloc(), return the address of a block of memory spanning
[38] Fix | Delete
* `size` bytes, or return NULL (without setting an exception) if enough
[39] Fix | Delete
* new memory can't be obtained. Unlike malloc(0), PyArena_Malloc() with
[40] Fix | Delete
* size=0 does not guarantee to return a unique pointer (the pointer
[41] Fix | Delete
* returned may equal one or more other pointers obtained from
[42] Fix | Delete
* PyArena_Malloc()).
[43] Fix | Delete
* Note that pointers obtained via PyArena_Malloc() must never be passed to
[44] Fix | Delete
* the system free() or realloc(), or to any of Python's similar memory-
[45] Fix | Delete
* management functions. PyArena_Malloc()-obtained pointers remain valid
[46] Fix | Delete
* until PyArena_Free(ar) is called, at which point all pointers obtained
[47] Fix | Delete
* from the arena `ar` become invalid simultaneously.
[48] Fix | Delete
*/
[49] Fix | Delete
PyAPI_FUNC(void *) PyArena_Malloc(PyArena *, size_t size);
[50] Fix | Delete
[51] Fix | Delete
/* This routine isn't a proper arena allocation routine. It takes
[52] Fix | Delete
* a PyObject* and records it so that it can be DECREFed when the
[53] Fix | Delete
* arena is freed.
[54] Fix | Delete
*/
[55] Fix | Delete
PyAPI_FUNC(int) PyArena_AddPyObject(PyArena *, PyObject *);
[56] Fix | Delete
[57] Fix | Delete
#ifdef __cplusplus
[58] Fix | Delete
}
[59] Fix | Delete
#endif
[60] Fix | Delete
[61] Fix | Delete
#endif /* !Py_PYARENA_H */
[62] Fix | Delete
#endif /* Py_LIMITED_API */
[63] Fix | Delete
[64] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function