octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #29475] new incompatibility of MEX function in


From: Jaroslav Hajek
Subject: [Octave-bug-tracker] [bug #29475] new incompatibility of MEX function in Octave 3.2.x
Date: Fri, 09 Apr 2010 08:09:52 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100204 SUSE/3.5.8-0.1.1 Firefox/3.5.8

Follow-up Comment #3, bug #29475 (project octave):

The change has been caused by John's changeset 9358:d4b1314a7c31,
that improved the decision procedure whether to make a copy. 
John, this works for double and integer matrices; we should either make it
work for chars as well, or remove it from everywhere.

Note that it is still a dangerous trick that should be reserved for internal
use. The data sharing mechanisms in Octave are probably quite different from
those of Matlab. In Matlab, apparently mxArray is a central structure; in
Octave, it's just a wrapper, so implementing mxUnshare would be quite
difficult because the wrapper would need to be provided with enough data to
reach the original octave_value.
Octave also often makes shared copies of values for its internal purposes,
like caching some conversions, Matlab probably doesn't.
Octave shares data in some situations where Matlab doesn't; for instance,
contiguous subarrays or conversions between cells and cs-lists. You should
bear these differences in mind.

In version 3.6 (or whatever major will be after 3.4), I intend to work on
some optimizations that will allow oct-files exploit calls like

X = myfun (X, y)

and, if applicable, operate on X in-place.

In any case, it will probably always hold that using the native C++ interface
is a better option if you want to do optimization tricks.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29475>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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