Re: [pcre-dev] A native pcre exec for JIT

Kezdőlap
Üzenet törlése
Szerző: Christian Persch
Dátum:  
Címzett: Zoltán Herczeg
CC: pcre-dev
Tárgy: Re: [pcre-dev] A native pcre exec for JIT
Hi;

Am Sat, 22 Sep 2012 13:43:57 +0200 (CEST)
schrieb Zoltán Herczeg <hzmester@???>:
> I have been thinking for some time, that the point of JIT is offering
> outstanding pattern matching performance (and it improved a lot
> lately) and it is still used through pcre_exec. So I am planning the
> add a new interface for JIT only:
>
> int pcre[16]_jit_exec(const pcre_extra *extra_data, PCRE_SPTR
> subject, int length, int start_offset, int options, int *offsets, int
> offsetcount, pcre_jit_stack *stack)
>
> Basically it is the same as pcre[16]_exec, excapt that re is removed
> and a jit stack argument is added. The interface of JIT is stable
> now, and I don't think it will be change much in the future.


I'm all in favour of more performance :-)

As for the API, even if the pcre* is unused, I'd still add it as first
argument, just in case (makes for a uniform API, and is future proof).

Also IMHO for *new* API we shouldn't continue the problems of the old
APIs; that means we should use size_t for the length, start_offset and
offsetcount parameters and the offsets themselves. (If the current code
can't cope, just reuturn an error if length > INT_MAX, but then we can
fix that without changing API.) Also, maybe options should be unsigned
(it's flags, right?).

Regards,
    Christian