Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::mpl -- compiler running out of memory
From: Dave Abrahams (dave_at_[hidden])
Date: 2010-12-31 17:22:19


On Thu, Dec 30, 2010 at 2:35 PM, Peter Foelsche <foelsche_at_[hidden]> wrote:
> I've some code, which is extensively using boost::mpl.
> It does not compile with g++ 4.5 or Visual C++ 2010 within 8GB of RAM
> -- always runs out of memory or runs into swapping (of course 64bit
> compiler).
> Is there any way to find out, how I can change this code to avoid needing so
> much memory?

The best clue I can give you is to try to reduce the number of
distinct template instantiations.

Consider the effects of doing get<0>(t), get<1>(t), ... get<N>(t) for
some tuple t before and after this change was made:
https://svn.boost.org/trac/boost/changeset/62683

It went from O(N^2) instantiations to O(N).

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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