Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Inplace array (mex)
Date: Sat, 27 Jun 2009 21:42:01 +0000 (UTC)
Organization: Boeing
Lines: 16
Message-ID: <h263n9$ham$1@fred.mathworks.com>
References: <h2540t$73d$1@fred.mathworks.com> <h25val$cna$1@fred.mathworks.com> <h2620t$162$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1246138921 17750 172.30.248.35 (27 Jun 2009 21:42:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 27 Jun 2009 21:42:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: news.mathworks.com comp.soft-sys.matlab:551131


"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.
- Use it in some way (e.g., call mexCallMATLAB to multiply it by 2)
- Detach the data pointer and then call mxDestroyArray on it.

2) Try something similar inside an engine application.

If the above work, then it would point to the garbage collection as the culprit. But I don't really know how to verify this.

James Tursa