compiling the above game requires at times about 500M of ram for some of the cc1plus processes, depending on the optimization options. one solution to make building it possible is to force the MAKEOPTS to -j1 alternatively, find the g++ bug causing this memory eating rampage and fix it...
Feel free to do any of those things. This isn't a bug in the ebuild.
see Bug 80309 another 'solution' is to take -pipe out of your CXXFLAGS