//
// operator new from 0xccd3c8 to 0xccd428 (96 bytes)
//
// 15 xrefs:
// > CCSpriteWithHue::create @ 0x5bc280
// > CCSpriteWithHue::create @ 0x5bc350
// > CCSpriteWithHue::createWithTexture @ 0x5bc420
// > CCSpriteWithHue::createWithTexture @ 0x5bc4f8
// > CCSpriteWithHue::createWithSpriteFrame @ 0x5bc5d4
// > CCSpriteGrayscale::create @ 0x5bd078
// > CCSpriteGrayscale::create @ 0x5bd148
// > CCSpriteGrayscale::createWithTexture @ 0x5bd218
// > CCSpriteGrayscale::createWithTexture @ 0x5bd2f0
// > CCSpriteGrayscale::createWithSpriteFrame @ 0x5bd3cc
// > processTrace @ 0x682244
// > __cxa_thread_atexit @ 0xccbb84
// > __cxa_thread_atexit @ 0xccbbdc
// > operator new[] @ 0xccd44c
// > ??> @ 0x52c08
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void *__fastcall operator new(size_t a1, const std::nothrow_t *a2)
{
size_t v2; // x19
void (*new_handler)(void); // x0
void *result; // x0
if ( a1 )
v2 = a1;
else
v2 = 1;
while ( 1 )
{
result = malloc(v2);
if ( result )
break;
new_handler = (void (*)(void))std::get_new_handler();
if ( !new_handler )
return nullptr;
new_handler();
}
return result;
}