Hello Philip

You're right, I didn't consider that this way, maybe except that extra useless computation is done.
Thank you for spending time on this question.
Actually, tables have been statically computed for each OS separately.
I will see what differences in behaviour will occur.

Kind regards,
Patrice.

[email protected] a écrit :
On Wed, 4 Mar 2020, Patrice Guérin wrote:

To be consistent with the pcre2_maketables_free() function in terms of
alloc/free usage,
provide a pcre2_maketables_reserve() function :

PCRE2_EXP_DEFN uint8_t * PCRE2_CALL_CONVENTION
pcre2_maketables_reserve(pcre2_general_context *gcontext, PCRE2_SIZE
*table_size )

which do the allocation, the same as at the beginning of pcre2_maketables()
and can be reused here
and return the table buffer and tables_length in table_size parameter.
Thanks for the idea, but:

I'm not sure what that gains over just using pcre2_maketables() and
having the length available so you can overwrite the tables if you want
to. An alternative is to have pcre2_maketables2() which returns an extra
parameter, but I think this is such a rare requirement, so I didn't want
to add too much to the API.

In dftables, add a -b option to save the table buffer after computation in
binary format instead of the C format ;
the file argument is unchanged.
That is a useful idea; I will consider it.

Philip



--
## List details at https://lists.exim.org/mailman/listinfo/pcre-dev

Reply via email to