mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Better mem_check reporting
This commit is contained in:
parent
c0fa3003d7
commit
2b6f991010
|
@ -240,7 +240,7 @@ void mem_zero(void *block,unsigned size)
|
|||
memset(block, 0, size);
|
||||
}
|
||||
|
||||
void mem_check()
|
||||
int mem_check_imp()
|
||||
{
|
||||
MEMHEADER *header = first;
|
||||
while(header)
|
||||
|
@ -249,10 +249,12 @@ void mem_check()
|
|||
if(tail->guard != MEM_GUARD_VAL)
|
||||
{
|
||||
dbg_msg("mem", "Memory check failed at %s(%d): %d", header->filename, header->line, header->size);
|
||||
dbg_assert(0, "Memory check failed");
|
||||
return 0;
|
||||
}
|
||||
header = header->next;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
IOHANDLE io_open(const char *filename, int flags)
|
||||
|
|
|
@ -166,7 +166,8 @@ int mem_comp(const void *a, const void *b, int size);
|
|||
Validates the heap
|
||||
Will trigger a assert if memory has failed.
|
||||
*/
|
||||
void mem_check();
|
||||
int mem_check_imp();
|
||||
#define mem_check() dbg_assert_imp(__FILE__, __LINE__, mem_check_imp(), "Memory check failed")
|
||||
|
||||
/* Group: File IO */
|
||||
enum {
|
||||
|
|
Loading…
Reference in a new issue