I am working on solving the potentially disasterous
memory leak in matlab2fmex.
This leak is caused by using pointers as function
results. It turns out this is a well documented leak
(see comp.lang.fortran) that I have just become aware
of. Using pointers as function returns seems necessary
because as in Matlab, the size of the return argument
can vary depending on the inputs to the function.
I am working on a fix for this will will create a
set of temporary variables which will point to function
results. These temporary vars will then be deallocated
thus removing the leak.
Log in to post a comment.