Autor: Ralf Junker Datum: To: pcre-dev@exim.org Betreff: [pcre-dev] JIT and alloca (X86)
I am using PCRE in an environment where alloca() is not available.
Unfortunately, JIT calls alloca() in sljitNativeX86_common.c, line 446.
As far as I understand, this call makes sure that enough stack space is
available. I experimented and found that alloca() is not necessary for
all pattern matches. I removed the alloca() call and JIT ran fine on
X86_32 but not on X86_64. However, if I provide a custom stack with
pcre_assign_jit_stack(), it runs well on both architectures even with
alloca() removed.
Questions:
* Is alloca() really not needed if a custom stack is provided?
* Would it be possible to replace alloca() with simple malloc() / free()?