Check integer overflow edge case
Check integer overflow edge case

In some implementations "operator new[]" throws "std::bad_array_new_length".
This patch try detect and avoid this situation.

agustingianni/retools,agustingianni/retools,agustingianni/retools,agustingianni/retools