[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/9] dfa: introduce alloc_posset
From: |
Jim Meyering |
Subject: |
Re: [PATCH 5/9] dfa: introduce alloc_posset |
Date: |
Tue, 03 Jan 2012 09:59:28 +0100 |
Paolo Bonzini wrote:
> * src/dfa.c (alloc_posset): New function, use it throughout.
> ---
> src/dfa.c | 22 ++++++++++++++--------
> 1 files changed, 14 insertions(+), 8 deletions(-)
ACK, but I would prefer a name like alloc_pos_set or
even alloc_position_set. "posset" is not as readable.
...
> +static void
> +alloc_posset (position_set *s, size_t size)
> +{
> + MALLOC(s->elems, size);
> + s->nelem = 0;
> +}
> +
> /* Insert position P in set S. S is maintained in sorted order on
> decreasing index. If there is already an entry in S with P.index
> then merge (logically-OR) P's constraints into the one in S.
> @@ -1934,7 +1941,7 @@ state_index (struct dfa *d, position_set const *s, int
> newline, int letter)
> /* We'll have to create a new state. */
> REALLOC_IF_NECESSARY(d->states, d->salloc, d->sindex + 1);
> d->states[i].hash = hash;
> - MALLOC(d->states[i].elems.elems, s->nelem);
> + alloc_posset(&d->states[i].elems, s->nelem);
...
- [PATCH 2/9] dfa: remove unnecessary braces, (continued)
- [PATCH 2/9] dfa: remove unnecessary braces, Paolo Bonzini, 2012/01/03
- [PATCH 3/9] dfa: use MALLOC/REALLOC always, Paolo Bonzini, 2012/01/03
- [PATCH 4/9] dfa: use a separate data type for grps, Paolo Bonzini, 2012/01/03
- [PATCH 5/9] dfa: introduce alloc_posset, Paolo Bonzini, 2012/01/03
- Re: [PATCH 5/9] dfa: introduce alloc_posset,
Jim Meyering <=
- [PATCH 6/9] dfa: remove dead assignment, Paolo Bonzini, 2012/01/03
- [PATCH 7/9] dfa: move nalloc to position_set structure, Paolo Bonzini, 2012/01/03
- [PATCH 8/9] dfa: change position_set nelem to size_t, Paolo Bonzini, 2012/01/03
- [PATCH 9/9] dfa: automatically resize position_sets, Paolo Bonzini, 2012/01/03