Mercurial > hg > vamp-plugin-sdk
changeset 336:50df48a51c97
Thread-safe base-fft
author | Chris Cannam |
---|---|
date | Mon, 09 Jul 2012 22:36:06 +0100 |
parents | 7d4aeb0d0d6c |
children | d5c5a52e6c9f |
files | src/vamp-hostsdk/PluginInputDomainAdapter.cpp |
diffstat | 1 files changed, 8 insertions(+), 21 deletions(-) [+] |
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) {