This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Avoid #ifdef _GLIBCXX_DEBUG in regex_compiler.h

On Mon, Sep 7, 2015 at 8:22 AM, Jonathan Wakely <> wrote:
> And we could get rid of the _Empty type, because std::bitset<0> is an
> empty type anyway, so if we made _S_cache_size()==0 when _UseCache is
> false then in the current code we could just unconditionally use:
>  using _CacheT = std::bitset<_S_cache_size()>;
> and for the suggested change to use a padding byte for the _M_is_ready
> flag we could use:
>      struct _ExtraMembers
>      : _Flags, bitset<_S_cache_size()>
>      {
>        explicit
>        _ExtraMembers(bool __is_non_matching)
>        : _Flags{__is_non_matching, false}
>        { }
>      };

I'm not fully awaring the context, but I planned to elimiate the cache
size dispatch based on char types by always using size 256 (to be
exact, the size of all possible unsigned char values) to cache the
smallest 256 results, regardless of the actual char type. It also
covers other char types and reduced the code complexity.

As for #ifdef _GLIBCXX_DEBUG, I think it's fine to delete them, since
they seem not catching any useful bugs.

Tim Shen

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]