Relocate declaration of alloc_lock outside ifdef block
authorMartin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Mon, 9 Jan 2017 00:10:43 +0000 (01:10 +0100)
committerGitHub <noreply@github.com>
Mon, 9 Jan 2017 00:10:43 +0000 (01:10 +0100)
driver/others/memory.c

index 5e4c4c1..b3c850a 100644 (file)
@@ -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