[pcre-dev] [Bug 1174] allow passing of pcre_{malloc, free, …

Top Page
Delete this message
Author: Philip Hazel
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 1174] allow passing of pcre_{malloc, free, stack_malloc, stack_free, callout} as parameters
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1174




--- Comment #1 from Philip Hazel <ph10@???> 2011-11-06 17:03:53 ---
This is a good point, and I should probably have sorted this out a very long
time ago. When I was implementing PCRE as something Exim could use, I didn't
think about threads (or many other things!) at all. The early releases made use
of a number of static variables. When I changed this (release 0.94, September
1997) I didn't think about library use, and I left the static variables that
contained the function pointers. Sigh. I wish my foresight was as good as my
hindsight.

I will think about how best to handle this. There will have to be a new
function called pcre_compile3() (we already have pcre_compile2) and I am
leaning towards a single argument pointing to a structure that contains
pointers to all the functions. Rather than add this to the extra data for
pcre_exec, it might be best to invent pcre_exec2() with an extra argument.
Other functions are also affected.

I won't actually be doing anything for several weeks at least (for various
reasons), but this will allow for some thought about how best to sort this out.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email