diff options
author | Imad-Eddine Srairi <imad.srairi@mckay-brothers.com> | 2019-03-18 18:01:57 +0100 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2019-04-21 17:27:16 +0200 |
commit | fb4cdd33215ff7cc0e8362d7a9281462cc92e11b (patch) | |
tree | 1f47629d5d50f2c82ffc369c47d9953a896dd835 | |
parent | 28f76917365a1348d9049102f0d9fde045d7dc4c (diff) |
Reduce peak memory usage of Octave function read_cshort_binary
Attempts to read large amounts of data with 'read_cshort_binary' may
make Octave 6.0.0 overflow and exit with the message:
'octave exited with signal 6'.
The purpose of this change is to use more sparingly memory in order
to avoid overflowing in cases where the computer *does* have enough
memory to perform the desired operation.
-rw-r--r-- | gr-utils/octave/read_cshort_binary.m | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gr-utils/octave/read_cshort_binary.m b/gr-utils/octave/read_cshort_binary.m index 149b6ca88c..203d908d8b 100644 --- a/gr-utils/octave/read_cshort_binary.m +++ b/gr-utils/octave/read_cshort_binary.m @@ -42,5 +42,8 @@ function cv = read_cshort_binary (filename, count) else v = fread (f, count, 'short'); fclose (f); - cv = v(1:2:end)+v(2:2:end)*j; + v_r = v(1:2:end); + v_i = v(2:2:end)*j; + clear v; + cv = v_r+v_i; end |