Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new API function pcre2_set_optimization() for controlling enabled optimizations #471

Merged
merged 1 commit into from
Sep 21, 2024

Commits on Sep 19, 2024

  1. Add new API function pcre2_set_optimization() for controlling enabled…

    … optimizations
    
    It is anticipated that over time, more and more optimizations will be
    added to PCRE2, and we want to be able to switch optimizations off/on,
    both for testing purposes and to be able to work around bugs in a
    released library version.
    
    The number of free bits left in the compile options word is very small.
    Hence, we will start putting all optimization enable/disable flags in
    a separate word. To switch these off/on, the new API function
    pcre2_set_optimization() will be used.
    
    The values which can be passed to pcre2_set_optimization() are
    different from the internal flag bit values. The values accepted by
    pcre2_set_optimization() are contiguous integers, so there is no
    danger of ever running out of them. This means in the future, the
    internal representation can be changed at any time without breaking
    backwards compatibility. Further, the 'directives' passed to
    pcre2_set_optimization() are not restricted to control a single,
    specific optimization. As an example, passing PCRE2_OPTIMIZATION_FULL
    will turn on all optimizations supported by whatever version of
    PCRE2 the client program happens to be linked with.
    
    Co-Authored-By: Carlo Marcelo Arenas Belón <carenas@gmail.com>
    Co-Authored-by: Zoltan Herczeg <hzmester@freemail.hu>
    3 people committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    81adc14 View commit details
    Browse the repository at this point in the history