Add MemoryBarrier for MinGW; freqPeak is unused

This commit is contained in:
Chris Cannam
2011-12-03 13:14:14 +00:00
parent c26dc1dc88
commit ecbbd73957
3 changed files with 6 additions and 7 deletions

View File

@@ -72,8 +72,6 @@ RubberBandStretcher::Impl::ChannelData::construct(const std::set<size_t> &sizes,
unwrappedPhase = allocate_and_zero<process_t>(realSize);
envelope = allocate_and_zero<process_t>(realSize);
freqPeak = allocate_and_zero<size_t>(realSize);
fltbuf = allocate_and_zero<float>(maxSize);
dblbuf = allocate_and_zero<process_t>(maxSize);
@@ -144,7 +142,6 @@ RubberBandStretcher::Impl::ChannelData::setSizes(size_t windowSize,
v_zero(prevPhase, realSize);
v_zero(prevError, realSize);
v_zero(unwrappedPhase, realSize);
v_zero(freqPeak, realSize);
return;
}
@@ -168,7 +165,6 @@ RubberBandStretcher::Impl::ChannelData::setSizes(size_t windowSize,
prevError = reallocate_and_zero(prevError, oldReal, realSize);
unwrappedPhase = reallocate_and_zero(unwrappedPhase, oldReal, realSize);
envelope = reallocate_and_zero(envelope, oldReal, realSize);
freqPeak = reallocate_and_zero(freqPeak, oldReal, realSize);
fltbuf = reallocate_and_zero(fltbuf, oldMax, maxSize);
dblbuf = reallocate_and_zero(dblbuf, oldMax, maxSize);
@@ -238,7 +234,6 @@ RubberBandStretcher::Impl::ChannelData::~ChannelData()
deallocate(prevError);
deallocate(unwrappedPhase);
deallocate(envelope);
deallocate(freqPeak);
deallocate(accumulator);
deallocate(windowAccumulator);
deallocate(fltbuf);

View File

@@ -99,8 +99,6 @@ public:
process_t *prevError;
process_t *unwrappedPhase;
size_t *freqPeak;
float *accumulator;
size_t accumulatorFill;
float *windowAccumulator;

View File

@@ -226,7 +226,13 @@ system_get_process_status(int pid)
#ifdef _WIN32
void system_memorybarrier()
{
#ifdef MemoryBarrier
MemoryBarrier();
#else /* (mingw) */
LONG Barrier = 0;
__asm__ __volatile__("xchgl %%eax,%0 "
: "=r" (Barrier));
#endif
}
#else /* !_WIN32 */
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)