This is the mail archive of the libstdc++@gcc.gnu.org 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: ints in parallel code


Paolo Carlini wrote:
> Paolo Carlini wrote:
>> today was going through the parallel code to do some more or less
>> formatting and uglifications fixes, when I noticed something potentially
>> much more serious: I'm seeing many plain ints around, also for things
>> which look like indexes in data, differences of iterators, things like
>> that.
> In particular, I wish you could double check the various ints used in
> the *multiway* functions, which seem all suspect to me.

All the ints in multiway*.h address sequences, i. e. the functions are
limited to about 2^31 sequences.  The number of elements in these
sequences can be much higher.

In principle, you are right, the sequences are passed using iterators,
and their difference could be 64 bits.  In practice, we are much further
away from having more than 2^31 sequences, than having more than 2^31
elements e. g. for sorting.

Anyway, do you want me to replace it with the appropriate
difference_type?  It might have performance implications, though.

Johannes


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