From 51aa157e64fa9ac411109c300ccc5505fb9d3a0a Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Mon, 9 Jan 2017 01:10:43 +0100 Subject: [PATCH] Relocate declaration of alloc_lock outside ifdef block --- driver/others/memory.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/driver/others/memory.c b/driver/others/memory.c index 5e4c4c111..b3c850a67 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -381,6 +381,16 @@ static int release_pos = 0; static int hot_alloc = 0; #endif +/* Global lock for memory allocation */ + +#if defined(USE_PTHREAD_LOCK) +static pthread_mutex_t alloc_lock = PTHREAD_MUTEX_INITIALIZER; +#elif defined(USE_PTHREAD_SPINLOCK) +static pthread_spinlock_t alloc_lock = 0; +#else +static BLASULONG alloc_lock = 0UL; +#endif + #ifdef ALLOC_MMAP static void alloc_mmap_free(struct release_t *release){ @@ -390,15 +400,7 @@ static void alloc_mmap_free(struct release_t *release){ } } -/* Global lock for memory allocation */ -#if defined(USE_PTHREAD_LOCK) -static pthread_mutex_t alloc_lock = PTHREAD_MUTEX_INITIALIZER; -#elif defined(USE_PTHREAD_SPINLOCK) -static pthread_spinlock_t alloc_lock = 0; -#else -static BLASULONG alloc_lock = 0UL; -#endif #ifdef NO_WARMUP