Boost logo

Boost Users :

Subject: Re: [Boost-users] [preprocessor] extending loop limit >> 256
From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2010-12-30 21:38:35


On Wed, 29 Dec 2010 13:01:22 +0100, Martin Pasdzierny wrote:

> using BOOST_PP_LOCAL_ITERATE() and friends I found the maximum number
> of iterations to be limited to 256.
>
> The according values seemed to be defined in
> .../preprocessor/config/limits.hpp
>
> But changing these values does *not* have any effect on the maximum
> number of iterations

No, it won't. Those definitions are informational.

> Stepping through the libraries code I found the mechanisms far more
> complicated than expected.
> Now my question: is there any recommended procedure to increase the
> iteration limitation to values like 10000 ?
>
> I found a couple of code locations explicitly repeating code with hard
> coded values from 1 ... 256.
> I guess at least this code needs to be extended, but probably consistent
> with some other changes.

Besides that, the main thing would be increasing how many digits are put
together on the bounding limits. I believe that the values in
LOCAL_LIMITS are evaluated (to avoid repetitive use of TUPLE_ELEM) by the
innards of the slot mechanism. That mechanism does 10 digit (base 10)
resolution. The local iteration mechanism only pulls the last three
digits (see boost/preprocessor/iteration/detail/{start,finish}.hpp at the
ends).

I haven't specifically looked at what it would take with the file-
iteration mechanism, but it would be similar (but in more places).

-Paul


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net