vector: add uint8 zero'ing function

master
Andre Puschmann 5 years ago
parent 8f72d4c55e
commit e495c4d553

@ -93,8 +93,8 @@ SRSLTE_API void* srslte_vec_realloc(void* ptr, uint32_t old_size, uint32_t new_s
/* Zero memory */ /* Zero memory */
SRSLTE_API void srslte_vec_cf_zero(cf_t* ptr, uint32_t nsamples); SRSLTE_API void srslte_vec_cf_zero(cf_t* ptr, uint32_t nsamples);
SRSLTE_API void srslte_vec_f_zero(float* ptr, uint32_t nsamples); SRSLTE_API void srslte_vec_f_zero(float* ptr, uint32_t nsamples);
SRSLTE_API void srslte_vec_u8_zero(uint8_t* ptr, uint32_t nsamples);
/* print vectors */ /* print vectors */
SRSLTE_API void srslte_vec_fprint_c(FILE* stream, const cf_t* x, const uint32_t len); SRSLTE_API void srslte_vec_fprint_c(FILE* stream, const cf_t* x, const uint32_t len);

@ -185,6 +185,11 @@ uint8_t* srslte_vec_u8_malloc(uint32_t nsamples)
return (uint8_t*)srslte_vec_malloc((uint32_t)sizeof(uint8_t) * nsamples); return (uint8_t*)srslte_vec_malloc((uint32_t)sizeof(uint8_t) * nsamples);
} }
void srslte_vec_u8_zero(uint8_t* ptr, uint32_t nsamples)
{
memset(ptr, 0, sizeof(uint8_t) * nsamples);
}
void srslte_vec_cf_zero(cf_t* ptr, uint32_t nsamples) void srslte_vec_cf_zero(cf_t* ptr, uint32_t nsamples)
{ {
memset(ptr, 0, sizeof(cf_t) * nsamples); memset(ptr, 0, sizeof(cf_t) * nsamples);

Loading…
Cancel
Save