Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Inplace array (mex)
Date: Sun, 28 Jun 2009 08:07:27 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 13
Message-ID: <h278bv$49d$1@fred.mathworks.com>
References: <h2540t$73d$1@fred.mathworks.com> <h25val$cna$1@fred.mathworks.com> <h2620t$162$1@fred.mathworks.com> <h263n9$ham$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246176447 4397 172.30.248.35 (28 Jun 2009 08:07:27 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 28 Jun 2009 08:07:27 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:551170


"James Tursa" <aclassyguywithaknotac@hotmail.com> wrote in message <h263n9$ham$1@fred.mathworks.com>...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <h2620t$162$1@fred.mathworks.com>...
> > 
> > My problem is I cannot even create such in-place pointer in a newer Matlab version (can't tell which one). It works all right in older Matlab version, e.g., 2006B. Actually I was surprised by the example given in your post, and that's why I come back and run INPLACECOLUMN under 2006B and it works. So now this is the scope. What is going on with the newer Matlabn version to prevent me doing such thing?
> 
> Hmmm ... I can't answer that. The only thing I can think of is that they have changed the way their garbage collection works when the mex function returns and for some reason this results in corrupted memory in the newer version. You might try a couple of things:
> 
> 1) Inside a single mex routine:
> - Create an inplace column mxArray shared variable.

James, I cannot even create an inplace shared variable, it crashes in the line mxSetPr. This occurs only on the recent Matlab version - I'm investigating from which version the problem arises. There is some internal mechanism that is not compatible with shared data. Quite annoying, because I can no longer optimize my code by using shared data.

Bruno