Commit d19dc900 authored by Paul Eggert's avatar Paul Eggert
Browse files

dfa: tune via xzalloc

* lib/dfa.c (dfaoptimize): Prefer xzalloc to xmalloc + memset.
parent e36f79ba
2019-12-17 Paul Eggert <eggert@cs.ucla.edu>
dfa: tune via xzalloc
* lib/dfa.c (dfaoptimize): Prefer xzalloc to xmalloc + memset.
2019-12-17 Bruno Haible <bruno@clisp.org>
 
localcharset: Fix multithread-safety bug on Windows and OS/2.
......@@ -2473,12 +2473,7 @@ reorder_tokens (struct dfa *d)
static void
dfaoptimize (struct dfa *d)
{
char *flags;
position_set merged0;
position_set *merged;
flags = xmalloc (d->tindex * sizeof *flags);
memset (flags, 0, d->tindex * sizeof *flags);
char *flags = xzalloc (d->tindex);
for (idx_t i = 0; i < d->tindex; i++)
{
......@@ -2497,7 +2492,8 @@ dfaoptimize (struct dfa *d)
flags[0] |= OPT_QUEUED;
merged = &merged0;
position_set merged0;
position_set *merged = &merged0;
alloc_position_set (merged, d->nleaves);
d->constraints = xnmalloc (d->tindex, sizeof *d->constraints);
......
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