Boost logo

Boost Users :

From: Russell Hind (rh_gmane_at_[hidden])
Date: 2006-06-29 12:53:56


Federico Feller wrote:
>
> After doing that, I tried to compile the code and got
> the following error from the compiler:
>
> [C++ Fatal Error] if.hpp(72): F1008 Out of memory
>

I have lots of problems using serialization under BCB6. Only with our
large data structures of many nested classes. A lot of our issues have
to do with inline expansions in release builds so disabling these helps,
but I have still got to the stage where we get problems even in debug
builds.

We get internal compiler errors. My guess is that the amount of
template code generated is just too much for the compiler, as simple,
small, classes serialize fine, but bigger ones can be pushed over the
edge by adding one more member to the list.

My best guess for us at a solution is to stop functions being template
based. I.e. if you know your class gets serialized to binary archives
only, create non-template functions that don't have to have
implementations in the header, and split them accross translation units
such as

void serialize_part1(binary_oarchive& boa);
void serialize_part2(binary_oarchive& boa);

I haven't tried this yet, but it is the only way I can think of to
reduce the load on the compiler. The serialization library does stress
the compiler quite badly because of the amount of inline-able and
template based code.

Cheers

Russell


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