Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: mxCreateNumericArray maximal array size
Replies: 8   Last Post: Jun 6, 2012 10:16 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
shlomi golubev

Posts: 4
Registered: 5/14/12
Re: mxCreateNumericArray maximal array size
Posted: May 15, 2012 6:31 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

guys, thanks a lot for your prompt replies. surly I would never try to allocate this much memory on a 32 bit system, nevertheless, the bug was on my side. I checked the return value of the mexcreate function and it wasn't 0, once I saw the core dump happens after mexcreate I understood the problem was in the way I use the pointer I got from the mexcreate. Indeed, I had something like this in the code

p=mxCreateNumericArray(3,dims,mxSINGLE_CLASS,complexFlag);

for (int i = 0; ; i++)
{
...
p[i]=something
...
if some condition then break
}

then the problem came clear to me, the problem was that the index I used was overflowing, after I changed the code to

for (long i = 0; ; i++)
{
...
p[i]=something
...
if some condition then break
}

the problem was solved.




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.