Throwing an exception for the first time may lead to calling calloc to allocate memory for __cxa_eh_globals. If the memory pool is exhausted at that moment, it results in abnormal termination of the program.
This patch addresses the issue by using fallback_malloc in that case.
Please don't use the __cxa prefix on these functions. It makes it seem like they are part of the Itanium spec but they're really internal details.