octave-maintainers
[Top][All Lists]
Advanced

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

Re: Mex API changes for 64bit


From: Christopher Hulbert
Subject: Re: Mex API changes for 64bit
Date: Sat, 2 Jun 2007 21:18:22 -0400

On 6/2/07, David Bateman <address@hidden> wrote:
As documented in the Matlab release notes for R2006b at

http://www.mathworks.com/access/helpdesk/help/techdoc/rn/bqt6wtq.html

two new types have been introduced to allow for 64-bit indexing into the
mex API. These are mwIndex for the indexing values and mwSize for sizes
of arrays, etc. They suggest at least that both are "int" normally, but
if the -largearraydims flag is used with mex or on a 64-bit platform,
then they are of type "size_t". I'd suggest it probably makes sense for
Octave to just typedef these to octave_idx_type.

Should octave also support the Matlab backwards compatibility option?
In compiling MEX functions, defining MX_COMPAT_32 keeps the old
definitions, but doesn't allow 64-bit indexing.

Chris


In any case the attached patch is an attempt to take these 64bit API
changes in the mex interface into account. I used the matlab external
API documentation of their website to get the new function prototypes
and then updated the underlying code to match. I probably missed a
couple of conversions of int -> {mwSize,mwIndex}, but at least for
32-bit systems that shouldn't be a big issue as mwIndex and mwSize both
resolve to "int".

I imagine without this patch the mex interface was probably broken on
64-bit platforms in any case.

Regards
David


reply via email to

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