mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Added finalization routines.
This commit is contained in:
parent
08c166152e
commit
aee094cc60
2 changed files with 44 additions and 1 deletions
|
@ -68,6 +68,26 @@ PyGrammar_AddAccelerators(g)
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
PyGrammar_RemoveAccelerators(g)
|
||||
grammar *g;
|
||||
{
|
||||
dfa *d;
|
||||
int i;
|
||||
g->g_accel = 0;
|
||||
d = g->g_dfa;
|
||||
for (i = g->g_ndfas; --i >= 0; d++) {
|
||||
state *s;
|
||||
int j;
|
||||
s = d->d_state;
|
||||
for (j = 0; j < d->d_nstates; j++, s++) {
|
||||
if (s->s_accel)
|
||||
PyMem_DEL(s->s_accel);
|
||||
s->s_accel = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
fixdfa(g, d)
|
||||
grammar *g;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue