Skip to content

Commit

Permalink
move M_Calloc out of the #ifndef BSD etc... block.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Nov 11, 2023
1 parent f399caa commit f4e479d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions source/common/utility/m_alloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ void *M_Realloc(void *memblock, size_t size)
return block;
}

void* M_Calloc(size_t v1, size_t v2)
{
auto p = M_Malloc(v1 * v2);
memset(p, 0, v1 * v2);
return p;
}

#else
void *M_Malloc(size_t size)
{
Expand Down Expand Up @@ -121,6 +114,14 @@ void *M_Realloc(void *memblock, size_t size)
return block;
}
#endif

void* M_Calloc(size_t v1, size_t v2)
{
auto p = M_Malloc(v1 * v2);
memset(p, 0, v1 * v2);
return p;
}

#else
#ifdef _MSC_VER
#include <crtdbg.h>
Expand Down

0 comments on commit f4e479d

Please sign in to comment.