This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] Optimize _BFSExecutor in regex


On Mon, Oct 7, 2013 at 12:22 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> because that turns into the equivalent of a std::memset() on integers.

Here I catch your idea. But think about the following example:
_M_exists.size() == 1000, but only 3 of the elements are true. Now
what I intend to do is assigning these 3 elements to false, rather
than reseting the whole vector. Is this called "pay for what you get"?

The ideal solution could be:

void _M_clear() {
    if (__exists.size() < _BaseT::size() * CPU_WORD_LENGTH * some_factor)
        clear_one_by_one();
    else
        reset_them_all();
}


-- 
Tim Shen


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