Ensure allocation size fits into size_t