octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Separation into dock widgets


From: John W. Eaton
Subject: Re: Separation into dock widgets
Date: Sat, 30 Apr 2011 10:11:57 -0400

On 30-Apr-2011, John Swensen wrote:

| I just went and looked at the code for the symbol_record class and
| it looks like the copy constructor only increased a reference
| counter.  It actually doesn't do a deep copy as you expected.  I
| noticed this because I went back to check why rand(10000,10000) in
| Quint wasn't using 2 times as much memory as the same command in
| just Octave.  I think this implies that despite the best intentions
| of OctaveLink, carrying around a reference to variables still being
| manipulated by the Octave internals destroy and thread-safetiness
| that OctaveLink is intended to provide, as you could access these
| references outside the Readline idle event loop.

Are you talking about copying octave_value objects?  If so, when you
copy one, the reference count for the actual data should be
incremented by the copy constructor or assignment operator.  Even if
you modify a value in the GUI while Octave does the same internally,
you should be OK, except that your changes in the GUI will not be
reflected internally in Octave due to the copy-on-write mechanism used
for octave_value objects.  Similarly, the changes to values inside
Octave will not appear in the GUI until you ask for the values again.

| I don't know if it is a related problem (I expect it is), but if you
| try to clear the large random matrix, Quint crashes.  Try: zz =
| rand(10000,10000); clear zz This crashes every time on both Ubuntu
| and OSX when updating the VariablesDockWidget. It doesn't happen for
| certain smaller variables, but I'm not sure why.

How are you clearing the variable?

Can you tell me where the copies you are concerned about are being
made?

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]