From 8bf7acdeaf3690369ea8fc7ce5b8795c72daaab5 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Sun, 22 Mar 2020 23:33:31 +0100 Subject: [PATCH] Added vector malloc for i32 and u32 --- lib/include/srslte/phy/utils/vector.h | 2 ++ lib/src/phy/utils/vector.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/include/srslte/phy/utils/vector.h b/lib/include/srslte/phy/utils/vector.h index 008df488b..c8590a4f1 100644 --- a/lib/include/srslte/phy/utils/vector.h +++ b/lib/include/srslte/phy/utils/vector.h @@ -82,6 +82,8 @@ SRSLTE_API cf_t srslte_vec_acc_cc(const cf_t* x, const uint32_t len); SRSLTE_API void* srslte_vec_malloc(uint32_t size); SRSLTE_API cf_t* srslte_vec_cf_malloc(uint32_t size); SRSLTE_API float* srslte_vec_f_malloc(uint32_t size); +SRSLTE_API int32_t* srslte_vec_i32_malloc(uint32_t nsamples); +SRSLTE_API uint32_t* srslte_vec_u32_malloc(uint32_t nsamples); SRSLTE_API int16_t* srslte_vec_i16_malloc(uint32_t nsamples); SRSLTE_API uint16_t* srslte_vec_u16_malloc(uint32_t nsamples); SRSLTE_API int8_t* srslte_vec_i8_malloc(uint32_t nsamples); diff --git a/lib/src/phy/utils/vector.c b/lib/src/phy/utils/vector.c index 35a3f6ece..c9849dcb6 100644 --- a/lib/src/phy/utils/vector.c +++ b/lib/src/phy/utils/vector.c @@ -154,6 +154,16 @@ float* srslte_vec_f_malloc(uint32_t nsamples) return (float*)srslte_vec_malloc((uint32_t)sizeof(float) * nsamples); } +int32_t* srslte_vec_i32_malloc(uint32_t nsamples) +{ + return (int32_t*)srslte_vec_malloc((uint32_t)sizeof(int32_t) * nsamples); +} + +uint32_t* srslte_vec_u32_malloc(uint32_t nsamples) +{ + return (uint32_t*)srslte_vec_malloc((uint32_t)sizeof(uint32_t) * nsamples); +} + int16_t* srslte_vec_i16_malloc(uint32_t nsamples) { return (int16_t*)srslte_vec_malloc((uint32_t)sizeof(int16_t) * nsamples);