diff options
author | David Sorber <david.sorber@blacklynx.tech> | 2021-10-18 08:54:12 -0400 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-10-25 11:27:01 -0400 |
commit | d4bd90853f499d5b65a61b3b7bf9ecf50e68bf6b (patch) | |
tree | d1bde0753540937bf6678f0cef1734d88ed5f9ce /gnuradio-runtime/lib/host_buffer.cc | |
parent | 47c374211221f3c636e0be2238ef233dd353697d (diff) |
runtime: replace the DEFINE_CUSTOM_BUFFER_TYPE() macro function with
some advanced template magic; also a few minor type corrections for
consistency
Signed-off-by: David Sorber <david.sorber@blacklynx.tech>
Diffstat (limited to 'gnuradio-runtime/lib/host_buffer.cc')
-rw-r--r-- | gnuradio-runtime/lib/host_buffer.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/gnuradio-runtime/lib/host_buffer.cc b/gnuradio-runtime/lib/host_buffer.cc index 535a7a5286..eb5d4bd515 100644 --- a/gnuradio-runtime/lib/host_buffer.cc +++ b/gnuradio-runtime/lib/host_buffer.cc @@ -14,8 +14,6 @@ namespace gr { -buffer_type host_buffer::type(buftype_HOST_BUFFER{}); - void* host_buffer::device_memcpy(void* dest, const void* src, std::size_t count) { // There is no spoon...er... device so fake it out using regular memcpy @@ -28,6 +26,22 @@ void* host_buffer::device_memmove(void* dest, const void* src, std::size_t count return std::memmove(dest, src, count); } +buffer_type host_buffer::type(buftype<host_buffer, host_buffer>{}); + +buffer_sptr host_buffer::make_buffer(int nitems, + size_t sizeof_item, + uint64_t downstream_lcm_nitems, + uint32_t downstream_max_out_mult, + block_sptr link, + block_sptr buf_owner) +{ + return buffer_sptr(new host_buffer(nitems, + sizeof_item, + downstream_lcm_nitems, + downstream_max_out_mult, + link, + buf_owner)); +} host_buffer::host_buffer(int nitems, size_t sizeof_item, |