|
|
Re: mxCreateNumericArray maximal array size
Posted:
May 15, 2012 6:31 AM
|
|
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.
|
|