mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2026-04-20 15:22:42 +00:00
even more stuff
This commit is contained in:
18
core/src/dsp/buffer/buffer.h
Normal file
18
core/src/dsp/buffer/buffer.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user