Skip to content

Commit

Permalink
jit: fix pcre2_jit_free_unused_memory() if sljit not using allocator (#…
Browse files Browse the repository at this point in the history
…165)

sljit allows building without an internal allocator, but instead using
an external one.

make sure to only invoke the corresponding sljit call if an internal
allocator is in use (the default and as coded in pcre integration) to
avoid problems if the code is changed to use an external allocator
instead.
  • Loading branch information
carenas committed Dec 1, 2022
1 parent 5d8a8bb commit 7846880
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pcre2_jit_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ pcre2_jit_free_unused_memory(pcre2_general_context *gcontext)
(void)gcontext; /* Suppress warning */
#else /* SUPPORT_JIT */
SLJIT_UNUSED_ARG(gcontext);
#if (defined SLJIT_EXECUTABLE_ALLOCATOR && SLJIT_EXECUTABLE_ALLOCATOR)
sljit_free_unused_memory_exec();
#endif /* SUPPORT_JIT */
#endif /* SLJIT_EXECUTABLE_ALLOCATOR */
#endif /* SUPPORT_JIT */
}


Expand Down

0 comments on commit 7846880

Please sign in to comment.