Link to home
Start Free TrialLog in
Avatar of ilyaz
ilyaz

asked on

DLL's: is the memory cleaned?

I am using MATLAB 5.0 on Sun Sparc with Sun OS 4 and call some MEX routines, which are actually in a dinamically linked library. What I am trying to do is to have two MEX functions which are connected by some global variables. The first function initializes the vars, the 2nd one uses them. There are 2 separate calls from MATLAB to each routine. It seems that contents of the global vars are lost after the first call so that when the 2nd functiona attempts to use them it gets garbage. Looks like the library is loaded to and then unloaded from the memory each time it is called. Is there a way around this? Should that be an option for compiler (the MEX funs are written in C and compiled using acc), for MATLAB or for something else?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of braveheart
braveheart

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial