This is the mail archive of the
mailing list for the GCC project.
Re: [Patch] Change default executor to DFS in regex
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Tim Shen <timshen91 at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 19 Oct 2013 21:12:16 +0200
- Subject: Re: [Patch] Change default executor to DFS in regex
- Authentication-results: sourceware.org; auth=none
- References: <CAPrifD=xODhzMevpww0BnkQh1Ju2btXxd-fFde=fN7nKzWmgBQ at mail dot gmail dot com> <CAPrifDn8QqtPm6T6qr-=2VNr0zh2XgQ7xPPdFRbKZQSJ16AHDg at mail dot gmail dot com> <52623CC6 dot 4070605 at oracle dot com> <CAPrifD=QOYnp8RTPKWaaUA26Du+eeseS7y7e-PNjHHMth4Cqww at mail dot gmail dot com>
On 10/19/2013 07:51 PM, Tim Shen wrote:
Yes, but giving it a name doesn't buy us much wrt the issue I pointed
out. For comparison, in similar cases, the compiler driver has --params
which the user can fine tune on the command line. The best approximation
we have got in the library - for the time being at least, in principle
the driver could also forward parameters to the library - is a macro,
which is defined and documented in a comment a few lines earlier and
then is possibly used to initialize a const static. Again, see the
stl_deque.h example. I can't imagine any other simple (and conforming!
eg, no additional template parms) solution.
On Sat, Oct 19, 2013 at 4:03 AM, Paolo Carlini <firstname.lastname@example.org> wrote:
About the < 2, in general hardcoding a parameter value in the code isn't a
nice idea. Why don't we take it out to a macro, say
_GLIBCXX_REGEX_NFA_QUANTIFIERS_LIMIT? In stl_deque.h we have something
similar and in the present case it would be even safe from the ABI point of
view, if I'm not mistaken.
I here use a const static local variable to hide it from other parts.