Mex bad allocation error

조회 수: 19 (최근 30일)
Itzik Ben Shabat
Itzik Ben Shabat 2015년 10월 30일
댓글: Itzik Ben Shabat 2015년 11월 1일
Hi,
I have a mex file which i run from matlab. It works fine. However, if i try to run it multiple times in a loop ( about 25 times) i get "Unexpected Standard exception from MEX file. What() is:bad allocation" What is this error and what do i need to look for in order to fix it ?
  댓글 수: 3
Jan
Jan 2015년 10월 30일
편집: Jan 2015년 10월 30일
Please post the corresponding part of the code. It is impossible to fix code, which is not known.
Itzik Ben Shabat
Itzik Ben Shabat 2015년 11월 1일
a. Yes, I am allocating memory within the MEX function.
b. The loop is outside the MEX function (iterating in MATLAB, not in the MEX).
when you ask for code snippet than i can understand you mean
I think I solved it - I forgot to delete some arrays i defined with pointers and using "new". so the block of memory was never released between runs. thanks anyway.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by