Re: [pcre-dev] JIT: Who owns stack created in pcre_jit_callb…

Αρχική Σελίδα
Delete this message
Συντάκτης: Zoltán Herczeg
Ημερομηνία:  
Προς: Ralf Junker
Υ/ο: pcre-dev@exim.org
Αντικείμενο: Re: [pcre-dev] JIT: Who owns stack created in pcre_jit_callback()?
Hi Ralf,

(sorry for misspelling your name before)

It is not recommended to allocate a stack in pcre_jit_callback() function since it is an expensive OS operation, and you still need to free it somehow (as you guessed). Its primary purpose is returning the stack for the current thread if you use the same pattern in many different threads. If your program is single threaded, it is better to assign the same stack for all patterns, and not use pcre_jit_callback() at all.

Regards,
Zoltan

Ralf Junker <ralfjunker@???> írta:
>The documentation (pcrejit.html) does not state clearly who owns the JIT>

stack created in the pcre_jit_callback() function.>
>

My tests indicate that it is *not* owned by pcre_extra because>
pcre_free_study() does not free it.>
>

So the application is responsible to call pcre_jit_stack_free() for any>
JIT stack created during pcre_jit_callback, right?>
>

Ralf>
>

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