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