Re: [hackers] [libgrapheme][PATCH] Expose cp_decode and boundary (both renamed) to the user

From: Laslo Hunhold <dev_AT_frign.de>
Date: Mon, 1 Jun 2020 11:22:58 +0200

On Sat, 9 May 2020 10:10:39 +0200
Mattias Andrée <maandree_AT_kth.se> wrote:

Dear Mattias,

> > I don't like this change, because it destroys reentrancy, which is
> > very importent for multithreaded applications, and complicates
> > things unnecessarily.
>
> malloc(3) and free(3) are thread-safe, so there shouldn't be any
> problem:
>
> GRAPHEME_STATE *state = grapheme_create_state(void);
> ... = grapheme_boundary(..., state);
> grapheme_free_state(state);

sorry, my bad, I thought it was an internal function that set up the
state internally.

>
> > However, I think we should just risk it and assume that further
> > versions of the Unicode-Grapheme-Boundary-algorithm will only rely
> > on such a state.
>
> I agree.

Yeah, I didn't like the create_state() and free_state() functions
anyway.

Your patch was marked in my inbox for a while (20 days more or less),
but I now took the time to incorporate the API-changes you suggested,
with small changes. Thanks for taking your time to bring up the
suggestions!

With best regards

Laslo
Received on Mon Jun 01 2020 - 11:22:58 CEST

This archive was generated by hypermail 2.3.0 : Mon Jun 01 2020 - 12:24:35 CEST