Commit 5b98eb1c authored by Marius Wachtler's avatar Marius Wachtler Committed by Kevin Modzelewski

sre: use malloc internally instead of our GC memory alloc routines

parent be24af74
...@@ -257,7 +257,9 @@ static void ...@@ -257,7 +257,9 @@ static void
data_stack_dealloc(SRE_STATE* state) data_stack_dealloc(SRE_STATE* state)
{ {
if (state->data_stack) { if (state->data_stack) {
PyMem_FREE(state->data_stack); // Pyston change: use malloc
// PyMem_FREE(state->data_stack);
free(state->data_stack);
state->data_stack = NULL; state->data_stack = NULL;
} }
state->data_stack_size = state->data_stack_base = 0; state->data_stack_size = state->data_stack_base = 0;
...@@ -273,7 +275,9 @@ data_stack_grow(SRE_STATE* state, Py_ssize_t size) ...@@ -273,7 +275,9 @@ data_stack_grow(SRE_STATE* state, Py_ssize_t size)
void* stack; void* stack;
cursize = minsize+minsize/4+1024; cursize = minsize+minsize/4+1024;
TRACE(("allocate/grow stack %" PY_FORMAT_SIZE_T "d\n", cursize)); TRACE(("allocate/grow stack %" PY_FORMAT_SIZE_T "d\n", cursize));
stack = PyMem_REALLOC(state->data_stack, cursize); // Pyston change: use malloc
// stack = PyMem_REALLOC(state->data_stack, cursize);
stack = realloc(state->data_stack, cursize);
if (!stack) { if (!stack) {
data_stack_dealloc(state); data_stack_dealloc(state);
return SRE_ERROR_MEMORY; return SRE_ERROR_MEMORY;
......
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