Commit 64b7d13e authored by Kevin Modzelewski's avatar Kevin Modzelewski Committed by Kevin Modzelewski

Conservatively-allocate the PyArena object

Not the actual memory blocks in it, but just the main metadata
object.  It contains pointers to other python objects; we could
potentially remove those pointers (looks like they are just for
reference counting) but for now just conservatively-allocate it.
parent 90b74680
......@@ -130,7 +130,8 @@ block_alloc(block *b, size_t size)
PyArena *
PyArena_New()
{
PyArena* arena = (PyArena *)malloc(sizeof(PyArena));
// Pyston change: conservatively allocate the PyArena metadata object
PyArena* arena = (PyArena *)PyMem_Malloc(sizeof(PyArena));
if (!arena)
return (PyArena*)PyErr_NoMemory();
......@@ -176,7 +177,8 @@ PyArena_Free(PyArena *arena)
*/
Py_DECREF(arena->a_objects);
free(arena);
// Pyston change:
PyMem_Free(arena);
}
void *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment