Files
sdrpp/core/src/dsp/buffer/buffer.h
AlexandreRouma d1318d3a0f even more stuff
2022-06-15 16:08:54 +02:00

18 lines
413 B
C++

#pragma once
#include <volk/volk.h>
namespace dsp::buffer {
template<class T>
inline T* alloc(int count) {
return (T*)volk_malloc(count * sizeof(T), volk_get_alignment());
}
template<class T>
inline void clear(T* buffer, int count, int offset = 0) {
memset(&buffer[offset], 0, count * sizeof(T));
}
inline void free(void* buffer) {
volk_free(buffer);
}
}