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][libstdc++-v3 parallel mode]


This is fine.

> +    for (int t = 0; t < k; t++)
> +      {
> +        if (stable)
> +          {
> +            if (seqs_begin[t].first == seqs_begin[t].second)
> +              lt.insert_start_stable(*arbitrary_element, t, true);
> +            else
> +              lt.insert_start_stable(*seqs_begin[t].first, t, false);
> +          }
> +        else
> +          {
> +            if (seqs_begin[t].first == seqs_begin[t].second)
> +              lt.insert_start(*arbitrary_element, t, true);
> +            else
> +              lt.insert_start(*seqs_begin[t].first, t, false);
> +          }
>        }

Code like this (and other parts of this file) makes me
think that this loop could be peeled via a template parameter on
the function (or lt object), and structure the code for this function as
a stable/notstable specializations (ie, stable policy). (or as
stable/non-stable specializations of LT.)

Just a thought.

It would probably be a lot cleaner.

-benjamin


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