refactor(memory): remove nullptr check before std::free
This commit is contained in:
parent
9e22f07200
commit
43f3b3dbdb
@ -64,7 +64,7 @@ namespace utils
|
|||||||
|
|
||||||
void* memory::allocate(const size_t length)
|
void* memory::allocate(const size_t length)
|
||||||
{
|
{
|
||||||
const auto data = calloc(length, 1);
|
const auto data = std::calloc(length, 1);
|
||||||
assert(data != nullptr);
|
assert(data != nullptr);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@ -78,10 +78,7 @@ namespace utils
|
|||||||
|
|
||||||
void memory::free(void* data)
|
void memory::free(void* data)
|
||||||
{
|
{
|
||||||
if (data)
|
std::free(data);
|
||||||
{
|
|
||||||
::free(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void memory::free(const void* data)
|
void memory::free(const void* data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user