From 453bb6c1b79d6d4fe4b1277336dc0f4097a5ee6b Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 12 Jun 2014 10:23:45 -0400 Subject: Use DMNSN_DEBUG macro instead of NDEBUG. --- libdimension/malloc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libdimension/malloc.c') diff --git a/libdimension/malloc.c b/libdimension/malloc.c index 786a2dc..2e4969d 100644 --- a/libdimension/malloc.c +++ b/libdimension/malloc.c @@ -28,7 +28,7 @@ #include #include -#ifndef NDEBUG +#if DMNSN_DEBUG static atomic_size_t dmnsn_allocs = ATOMIC_VAR_INIT(0); #endif @@ -40,7 +40,7 @@ dmnsn_malloc(size_t size) dmnsn_error("Memory allocation failed."); } -#ifndef NDEBUG +#if DMNSN_DEBUG atomic_fetch_add(&dmnsn_allocs, 1); #endif @@ -50,7 +50,7 @@ dmnsn_malloc(size_t size) void * dmnsn_realloc(void *ptr, size_t size) { -#ifndef NDEBUG +#if DMNSN_DEBUG if (!ptr) { atomic_fetch_add(&dmnsn_allocs, 1); } @@ -74,7 +74,7 @@ dmnsn_strdup(const char *s) void dmnsn_free(void *ptr) { -#ifndef NDEBUG +#if DMNSN_DEBUG if (ptr) { atomic_fetch_sub(&dmnsn_allocs, 1); } @@ -83,7 +83,7 @@ dmnsn_free(void *ptr) free(ptr); } -#ifndef NDEBUG +#if DMNSN_DEBUG DMNSN_LATE_DESTRUCTOR static void dmnsn_leak_check(void) { -- cgit v1.2.3