summaryrefslogtreecommitdiffstats
path: root/Parser/acceler.c
diff options
context:
space:
mode:
Diffstat (limited to 'Parser/acceler.c')
-rw-r--r--Parser/acceler.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Parser/acceler.c b/Parser/acceler.c
index 6ed12c3..63919c5 100644
--- a/Parser/acceler.c
+++ b/Parser/acceler.c
@@ -44,7 +44,7 @@ PyGrammar_RemoveAccelerators(grammar *g)
s = d->d_state;
for (j = 0; j < d->d_nstates; j++, s++) {
if (s->s_accel)
- PyMem_DEL(s->s_accel);
+ PyObject_FREE(s->s_accel);
s->s_accel = NULL;
}
}
@@ -68,7 +68,7 @@ fixstate(grammar *g, state *s)
int *accel;
int nl = g->g_ll.ll_nlabels;
s->s_accept = 0;
- accel = PyMem_NEW(int, nl);
+ accel = (int *) PyObject_MALLOC(nl * sizeof(int));
for (k = 0; k < nl; k++)
accel[k] = -1;
a = s->s_arc;
@@ -124,7 +124,7 @@ fixstate(grammar *g, state *s)
k++;
if (k < nl) {
int i;
- s->s_accel = PyMem_NEW(int, nl-k);
+ s->s_accel = (int *) PyObject_MALLOC((nl-k) * sizeof(int));
if (s->s_accel == NULL) {
fprintf(stderr, "no mem to add parser accelerators\n");
exit(1);
@@ -134,5 +134,5 @@ fixstate(grammar *g, state *s)
for (i = 0; k < nl; i++, k++)
s->s_accel[i] = accel[k];
}
- PyMem_DEL(accel);
+ PyObject_FREE(accel);
}