Merge pull request #83 from diamante0018/main
refactor(memory): remove nullptr check before std::free
This commit is contained in:
commit
a489cbe600
@ -72,7 +72,7 @@ namespace utils
|
|||||||
|
|
||||||
void* memory::allocate(const size_t length)
|
void* memory::allocate(const size_t length)
|
||||||
{
|
{
|
||||||
return calloc(length, 1);
|
return std::calloc(length, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
char* memory::duplicate_string(const std::string& string)
|
char* memory::duplicate_string(const std::string& string)
|
||||||
@ -84,10 +84,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…
Reference in New Issue
Block a user