#include <assert.h>
#include <string.h>
#include <stdlib.h>
-#include <math.h>
+#include <cmath>
#include <algorithm>
lock_guard<recursive_mutex> lock(mutex_);
+ // If we're out of memory, this will throw std::bad_alloc
data_.resize((sample_count_ + sample_count) * sizeof(float));
float *dst = (float*)data_.data() + sample_count_;