static void* FailRealloc(TRI_memory_zone_t* zone, void* old, size_t n) { // we can fail, so let's check whether we should fail intentionally... if (zone->_failable && ShouldFail(n)) { // intentionally return NULL errno = ENOMEM; return nullptr; } return BuiltInRealloc(old, n); }
static char* FailMalloc (TRI_memory_zone_t* zone, size_t n) { // we can fail, so let's check whether we should fail intentionally... if (zone->_failable && ShouldFail(n)) { // intentionally return NULL errno = ENOMEM; return nullptr; } return static_cast<char*>(BuiltInMalloc(n)); }