Joel Andersson
2015-06-23 11:08:49 UTC
Hi all,
I'm back working on the MATLAB module now. I'm trying to resolve some (for
me blocking) low-level issues before moving on to trying to get the unit
tests to pass.
The first thing I did was to refactor the way persistent memory is handled,
i.e. pointer objects in SWIG. The MATLAB proxy classes now no longer holds
raw C/C++ pointers or type information directly, but only a reference to an
internal memory manager. This should both be safer and have less overhead.
I also introduced calls to mexLock/mexUnlock to prevent the wrappers to be
deallocated prematurely. For me at least, this resolves the memory issues
I've had. From what I can tell, I can exit MATLAB at any time and memory
get properly deallocated. But I didn't do extensive testing, so if there
are still lingering memory issues, let me know. Here is a link to the
corresponding issue: https://github.com/jaeandersson/swig/issues/22.
The next thing I was planning to do was to refactor the overloading of
MATLAB's subsref and subsasgn (this controls all function calls and access
to data members, so it's quite central). The current implementation is not
working well and I prefer to make a proper, more efficient and generic
reimplementation than trying to debug the current one. Hopefully this will
resolve Kris' memberconstantHandler problem.
I also need to get multiple modules to work within the next couple of weeks
(hard deadline at the end of July).
Best regards,
Joel
I'm back working on the MATLAB module now. I'm trying to resolve some (for
me blocking) low-level issues before moving on to trying to get the unit
tests to pass.
The first thing I did was to refactor the way persistent memory is handled,
i.e. pointer objects in SWIG. The MATLAB proxy classes now no longer holds
raw C/C++ pointers or type information directly, but only a reference to an
internal memory manager. This should both be safer and have less overhead.
I also introduced calls to mexLock/mexUnlock to prevent the wrappers to be
deallocated prematurely. For me at least, this resolves the memory issues
I've had. From what I can tell, I can exit MATLAB at any time and memory
get properly deallocated. But I didn't do extensive testing, so if there
are still lingering memory issues, let me know. Here is a link to the
corresponding issue: https://github.com/jaeandersson/swig/issues/22.
The next thing I was planning to do was to refactor the overloading of
MATLAB's subsref and subsasgn (this controls all function calls and access
to data members, so it's quite central). The current implementation is not
working well and I prefer to make a proper, more efficient and generic
reimplementation than trying to debug the current one. Hopefully this will
resolve Kris' memberconstantHandler problem.
I also need to get multiple modules to work within the next couple of weeks
(hard deadline at the end of July).
Best regards,
Joel
--
--
Joel Andersson, PhD
Ptge. Busquets 11-13, atico 3
E-08940 Cornella de Llobregat (Barcelona), Spain
Home: +34-93-6034011
Mobile: +34-63-4408800 (in Sweden also +46-707-360512)
--
Joel Andersson, PhD
Ptge. Busquets 11-13, atico 3
E-08940 Cornella de Llobregat (Barcelona), Spain
Home: +34-93-6034011
Mobile: +34-63-4408800 (in Sweden also +46-707-360512)