diff src/vamp-hostsdk/PluginInputDomainAdapter.cpp @ 336:50df48a51c97

Thread-safe base-fft
author Chris Cannam
date Mon, 09 Jul 2012 22:36:06 +0100
parents 7920b9519fd9
children d5c5a52e6c9f
line wrap: on
line diff
--- a/src/vamp-hostsdk/PluginInputDomainAdapter.cpp	Sat Jun 30 14:12:43 2012 +0100
+++ b/src/vamp-hostsdk/PluginInputDomainAdapter.cpp	Mon Jul 09 22:36:06 2012 +0100
@@ -626,28 +626,15 @@
 	}
     }
 
-    static unsigned int tableSize = 0;
-    static int *table = 0;
+    int table[n];
 
-    if (tableSize != n) {
-
-	delete[] table;
-
-	table = new int[n];
-
-	for (i = 0; i < n; ++i) {
-	
-	    m = i;
-
-	    for (j = k = 0; j < bits; ++j) {
-		k = (k << 1) | (m & 1);
-		m >>= 1;
-	    }
-
-	    table[i] = k;
-	}
-
-	tableSize = n;
+    for (i = 0; i < n; ++i) {
+        m = i;
+        for (j = k = 0; j < bits; ++j) {
+            k = (k << 1) | (m & 1);
+            m >>= 1;
+        }
+        table[i] = k;
     }
 
     if (ii) {