diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-12-25 05:22:59 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-12-25 05:22:59 +0100 |
commit | b855183f0878fac7f09017539b6a4504e00cf6e4 (patch) | |
tree | b98753dac466735020681b7534787b2133fd204c /src/FrequencyInterleaver.cpp | |
parent | 8ff127f33a6173d612a00a7c3cb4dd25b9bffcd0 (diff) | |
parent | 515959935cd7c741db5aca5b20bfb7611749fbfb (diff) | |
download | dabmod-b855183f0878fac7f09017539b6a4504e00cf6e4.tar.gz dabmod-b855183f0878fac7f09017539b6a4504e00cf6e4.tar.bz2 dabmod-b855183f0878fac7f09017539b6a4504e00cf6e4.zip |
Merge branch 'next' into outputRefactoring
Diffstat (limited to 'src/FrequencyInterleaver.cpp')
-rw-r--r-- | src/FrequencyInterleaver.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/FrequencyInterleaver.cpp b/src/FrequencyInterleaver.cpp index 29d54bb..e76d525 100644 --- a/src/FrequencyInterleaver.cpp +++ b/src/FrequencyInterleaver.cpp @@ -24,7 +24,8 @@ #include <stdio.h> #include <stdexcept> -#include <malloc.h> +#include <string> +#include <stdlib.h> #include <complex> typedef std::complex<float> complexf; @@ -68,7 +69,11 @@ FrequencyInterleaver::FrequencyInterleaver(size_t mode) : break; } - d_indexes = (size_t*)memalign(16, d_carriers * sizeof(size_t)); + const int ret = posix_memalign((void**)(&d_indexes), 16, d_carriers * sizeof(size_t)); + if (ret != 0) { + throw std::runtime_error("memory allocation failed: " + std::to_string(ret)); + } + size_t* index = d_indexes; size_t perm = 0; PDEBUG("i: %4u, R: %4u\n", 0, 0); |