message(WARNING "submodule contrib/mimalloc is missing. to fix try run: \n git submodule update --init --recursive")
return()
endif()
if(ENABLE_MIMALLOC)
message(FATAL_ERROR "Mimalloc is not production ready. (Disable with cmake -D ENABLE_MIMALLOC=0). If you want to use mimalloc, you must manually remove this message.")
DB::throwFromErrno("MiAllocator: Cannot allocate in mimalloc "+formatReadableSizeWithBinarySuffix(size)+".",DB::ErrorCodes::CANNOT_ALLOCATE_MEMORY);
}
else
{
ptr=mi_malloc_aligned(size,alignment);
if(!ptr)
DB::throwFromErrno("MiAllocator: Cannot allocate in mimalloc (mi_malloc_aligned) "+formatReadableSizeWithBinarySuffix(size)+" with alignment "+toString(alignment)+".",DB::ErrorCodes::CANNOT_ALLOCATE_MEMORY);
DB::throwFromErrno("MiAllocator: Cannot reallocate in mimalloc (mi_realloc_aligned) "+formatReadableSizeWithBinarySuffix(size)+" with alignment "+toString(alignment)+".",DB::ErrorCodes::CANNOT_ALLOCATE_MEMORY);