int err = errno;
-#ifdef USE_MTAG
/* Quickly check that the freed pointer matches the tag for the memory.
This gives a useful double-free detection. */
- *(volatile char *)mem;
-#endif
+ if (__glibc_unlikely (mtag_enabled))
+ *(volatile char *)mem;
__libc_lock_lock (main_arena.mutex);
p = mem2chunk_check (mem, NULL);
return NULL;
}
-#ifdef USE_MTAG
/* Quickly check that the freed pointer matches the tag for the memory.
This gives a useful double-free detection. */
- *(volatile char *)oldmem;
-#endif
+ if (__glibc_unlikely (mtag_enabled))
+ *(volatile char *)oldmem;
__libc_lock_lock (main_arena.mutex);
const mchunkptr oldp = mem2chunk_check (oldmem, &magic_p);
if (mem == 0) /* free(0) has no effect */
return;
-#ifdef USE_MTAG
/* Quickly check that the freed pointer matches the tag for the memory.
This gives a useful double-free detection. */
- *(volatile char *)mem;
-#endif
+ if (__glibc_unlikely (mtag_enabled))
+ *(volatile char *)mem;
int err = errno;
if (oldmem == 0)
return __libc_malloc (bytes);
-#ifdef USE_MTAG
/* Perform a quick check to ensure that the pointer's tag matches the
memory's tag. */
- *(volatile char*) oldmem;
-#endif
+ if (__glibc_unlikely (mtag_enabled))
+ *(volatile char*) oldmem;
/* chunk corresponding to oldmem */
const mchunkptr oldp = mem2chunk (oldmem);