Mercurial > hg > octave-lyh
changeset 14987:65f74f52886c
Memory leaks with matrices in JIT
* src/pt-jit.cc (octave_jit_cast_any_matrix): Delete matrix.
(octave_jit_cast_matrix_any): Release octave base value.
(jit_info::execute): Clear previous variable.
* src/pt-jit.h (jit_array::jit_array): Do not grab dimensions.
(jit_array::grab_dimensions): Remove method.
author | Max Brister <max@2bass.com> |
---|---|
date | Tue, 10 Jul 2012 21:25:51 -0500 |
parents | 70ff15b6d996 |
children | 822d52bee973 |
files | src/pt-jit.cc src/pt-jit.h |
diffstat | 2 files changed, 4 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/pt-jit.cc +++ b/src/pt-jit.cc @@ -176,6 +176,7 @@ octave_value ret (*m->array); octave_base_value *rep = ret.internal_rep (); rep->grab (); + delete m->array; return rep; } @@ -185,6 +186,7 @@ { NDArray m = obv->array_value (); *ret = m; + obv->release (); } extern "C" double @@ -3636,10 +3638,11 @@ { if (arguments[i].second) { - octave_value current = symbol_table::varval (arguments[i].first); + octave_value ¤t = symbol_table::varref (arguments[i].first); octave_base_value *obv = current.internal_rep (); obv->grab (); real_arguments[i] = obv; + current = octave_value (); } }