help-octave
[Top][All Lists]
Advanced

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

Re: Realtime cost of call by value


From: pkienzle
Subject: Re: Realtime cost of call by value
Date: Fri, 31 Oct 2003 21:25:23 -0000

On 30 Oct 2003 at 13:49, John W. Eaton wrote:

> On 30-Oct-2003, address@hidden <address@hidden> wrote:
> 
> | Well, drawing a parallel from the weakly-typed nature of variables in
> | the Octave interpreter, I believe that it should be possible to have
> | these references to all types.
> 
> No, you can't have one reference that works for all types.  At least
> not a reference to the actual underlying data.  Because for that you
> need to know the exact type of the underlying data.  You can have a
> reference to a generic octave_value object, but that is not the same
> as having a reference to the actual data (which is what the OP needed
> to gain efficiency).

If I recall the example you gave many messages back,
you suggested doing a make_unique() in the code for
matrix_reference().  Since you are guaranteed nobody
else has a pointer to your data at this point, could you
not then also change its type?  

Of course this would require replacing the rep in the 
octave_value to an octave_value of the new type.  Would
a make_unique() on the octave_value solve that?

Paul Kienzle



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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