X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=stat.c;fp=stat.c;h=650bccdf040a0f83a324c70b94a545086d70aef4;hp=bf92c98db416be3c7fec695c706d8a3aaecc13dd;hb=ac8c7d730a7d0728facbdddea984a631037055aa;hpb=fa7d44e0c7d67a0c6cb9b59f00328569100721b1 diff --git a/stat.c b/stat.c index bf92c98..650bccd 100644 --- a/stat.c +++ b/stat.c @@ -141,7 +141,7 @@ void *stat_mem_allocate(size_t size, size_t line, const char *file, const char * info->expr = expr; info->prev = NULL; info->next = stat_mem_block_root; - + /* Write identifier */ memcpy(info + 1, IDENT_MEM, IDENT_SIZE); @@ -167,7 +167,7 @@ void *stat_mem_allocate(size_t size, size_t line, const char *file, const char * void stat_mem_deallocate(void *ptr, size_t line, const char *file) { stat_mem_block_t *info = NULL; char *ident = (char *)ptr - IDENT_SIZE; - + if (GMQCC_UNLIKELY(!ptr)) return; @@ -176,7 +176,7 @@ void stat_mem_deallocate(void *ptr, size_t line, const char *file) { if (!strcmp(ident, IDENT_VEC)) { vector_t *vec = (vector_t*)((char *)ptr - IDENT_VEC_TOP); stat_mem_block_t *block = (stat_mem_block_t*)((char *)vec - IDENT_MEM_TOP); - + VALGRIND_MAKE_MEM_DEFINED(block, sizeof(stat_mem_block_t)); con_err("internal warning: invalid use of mem_d:\n"); con_err("internal warning: vector (used elements: %u, allocated elements: %u)\n",