On 6/28/13 6:40 , "Paolo Bonzini" <pbonz...@redhat.com> wrote:
>Il 28/06/2013 12:40, Laszlo Ersek ha scritto: >>> > Also, this is not running in the context of qemu-ga, so I think it is >>> > better to be more conservative and trap memory allocation failure. >> In that case other "new" calls must assume the nothrow form too, plus >> other allocation functions should be checked as well (eg. >> SysAllocStringLen(), although its only use might be in the function that >> Tomoki plans to remove anyway). > >Agreed (nothrow or try...catch, depending on what's better for the C++ >runtime; I tried something like 'main(){ for(;;) new int[999]; }' and it caused: Terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc abnormal program termination I should catch and handle this. > by the way, Tomoki-san, I suspect this will require libstdc++ >when compiled with GCC---can you confirm?). Yes, we need "libstdc++-6.dll" from MinGW to run qemu-ga.exe. >Thanks, > >Paolo Thanks, Tomoki Sekiyama