regex caching is done by the ast regcache(3) in libast/regex/regcache.c
        regex_t* regcache(const char* pattern, regflags_t reflags, int* status);
the pattern and reflags args as the same as regcomp()
the status arg holds the regcomp() return value for patterns not in the cache

the cache is process global
when the cache fills the least recently used RE is replaced
it keeps track of the pattern, regcomp(REG_*) flags, and locale
if none of those match then a new entry is created

On Mon, 22 Nov 2010 08:07:46 +0100 =?KOI8-R?B?z8zYx8Egy9LZ1sHOz9fTy8HR?= wrote:
> How does ksh cache compiled regex? Are the compiled regex cached in a
> global cache or does ksh compile the regex once and store it together
> with the byte code for the specific line of shell code in which it is
> used?

> Olga
> -- 
>       ,   _                                    _   ,
>      { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
> .----'-/`-/     [email protected]   \-`\-'----.
>  `'-..-| /       http://twitter.com/fleyta     \ |-..-'`
>       /\/\     Solaris/BSD//C/C++ programmer   /\/\
>       `--`                                      `--`
> _______________________________________________
> ast-developers mailing list
> [email protected]
> https://mailman.research.att.com/mailman/listinfo/ast-developers

_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to