
31 Dec
2010
31 Dec
'10
10:22 p.m.
On Thu, Dec 30, 2010 at 2:35 PM, Peter Foelsche
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