Skip to content

Commit fb4cdd3

Browse files
Imad-Eddine Srairimarcusmueller
Imad-Eddine Srairi
authored andcommitted
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.
1 parent 28f7691 commit fb4cdd3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gr-utils/octave/read_cshort_binary.m

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,8 @@
4242
else
4343
v = fread (f, count, 'short');
4444
fclose (f);
45-
cv = v(1:2:end)+v(2:2:end)*j;
45+
v_r = v(1:2:end);
46+
v_i = v(2:2:end)*j;
47+
clear v;
48+
cv = v_r+v_i;
4649
end

0 commit comments

Comments
 (0)