Author: Philip Hazel Date: To: Jean-Christophe Deschamps CC: pcre-dev Subject: Re: [pcre-dev] Omitting DFA engine
On Tue, 25 May 2010, Jean-Christophe Deschamps wrote:
> My context is embedding PCRE into the core of a Windows scripting
> language (AutoIt).
> Our developpers have PCRE working for years, but they didn't include
> UCP support. The debate is about the increased executable size.
> Since we have absolutely no use of the DFA engine, is it harmless to
> completely empty the pcre-dfa-exec() function and get rid of all other
> code in pcre_dfa_exec.c ? Keeping things this way would minimize
> changes to building process.
Sure. If you aren't using it, there's not reason to include it. I don't
understand how Windows works, but in other operating systems when you
link an application with a static library, only those functions that you
actually use get called in. Having pcre_exec() and pcre_dfa_exec() in
separate modules is supposed to ensure this. (In the very first releases
of PCRE, when there were no "optional" functions, all the code was in
one module. But it was a lot smaller!)
If you can't achieve the omission automatically, can you not just link
your application with the appropriate PCRE object files, but omitting
pcre_dfa_exec()? In a Unix environment I'd just include those .o files
that held the functions I wanted, bypassing the pre-linked library.
(This is the way it was done when PCRE was embedded in Exim.)
Anyway, however you do it, it should work.
This message was posted to the following mailing lists: