Summary: bmalloc::api methods should maintain crash behavior even if bmalloc is disabled internally Notes: bmalloc.h describes a number of methods as crashing on failure: // Crashes on failure. inline void* malloc(size_t size) // Crashes on failure. inline void* memalign(size_t alignment, size_t size) // Crashes on failure. inline void* realloc(void* object, size_t newSize) However, bmalloc may be disabled internally for a number of reasons, such as running with GuardMalloc: bool Environment::computeIsBmallocEnabled() { if (isMallocEnvironmentVariableSet()) return false; if (isLibgmallocEnabled()) return false; if (isSanitizerEnabled()) return false; return true; } In those cases, it look like the bmalloc::api methods may return nullptr, instead of crashing. Perhaps the fall back to system malloc behaviors should BMALLOC_ASSERT and crash if null to maintain the expected bmalloc behavior. For example: bmalloc/Allocator.cpp 86-void* Allocator::reallocate(void* object, size_t newSize) 87-{ 88: if (!m_isBmallocEnabled) 89- return realloc(object, newSize); 90- -- 172-void* Allocator::allocateSlowCase(size_t size) 173-{ 174: if (!m_isBmallocEnabled) 175- return malloc(size); 176-