summaryrefslogtreecommitdiffstats
path: root/Python/asdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/asdl.c')
-rw-r--r--Python/asdl.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Python/asdl.c b/Python/asdl.c
index 07ad4b3..ccd8714 100644
--- a/Python/asdl.c
+++ b/Python/asdl.c
@@ -2,17 +2,18 @@
#include "asdl.h"
asdl_seq *
-asdl_seq_new(int size)
+asdl_seq_new(int size, PyArena *arena)
{
asdl_seq *seq = NULL;
size_t n = sizeof(asdl_seq) +
(size ? (sizeof(void *) * (size - 1)) : 0);
- seq = (asdl_seq *)PyObject_Malloc(n);
+ seq = (asdl_seq *)malloc(n);
if (!seq) {
PyErr_NoMemory();
return NULL;
}
+ PyArena_AddMallocPointer(arena, (void *)seq);
memset(seq, 0, n);
seq->size = size;
return seq;
@@ -21,6 +22,4 @@ asdl_seq_new(int size)
void
asdl_seq_free(asdl_seq *seq)
{
- PyObject_Free(seq);
}
-