- Don't inline M_Calloc() calls because GCC is shit.

* Fixes #1009.
This commit is contained in:
Christoph Oelckers 2023-11-11 21:51:30 +01:00 committed by Mitchell Richters
parent 13d57cdbd6
commit 34129e8484
2 changed files with 9 additions and 6 deletions

View file

@ -77,6 +77,14 @@ void *M_Realloc(void *memblock, size_t size)
GC::ReportRealloc(oldsize, _msize(block)); GC::ReportRealloc(oldsize, _msize(block));
return block; 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 #else
void *M_Malloc(size_t size) void *M_Malloc(size_t size)
{ {

View file

@ -72,12 +72,7 @@ inline void* M_Calloc_Dbg(size_t v1, size_t v2, const char* file, int lineno)
#else #else
void *M_Malloc (size_t size); void *M_Malloc (size_t size);
void *M_Realloc (void *memblock, size_t size); void *M_Realloc (void *memblock, size_t size);
inline void* M_Calloc(size_t v1, size_t v2) void* M_Calloc(size_t v1, size_t v2);
{
auto p = M_Malloc(v1 * v2);
memset(p, 0, v1 * v2);
return p;
}
#endif #endif