03-14-2013 05:38 AM
Hi
I'm trying to optimizing a program made of a model implemented in c++ and a labview interface. labview keep calling the dll saving and feeding back the result of the model. Now the c++ is huge and it's not optimized or well commented. My problem is this a variable is set at the first call of the dll and then never set again but is used. So it' look like to me like the dll reserve a space in the memory and keep using it. Is this correct? I thought that the dll work similar to a function that is called reserve memory use it, then as soon as it is done is close and the memory is use if needed for something else.
Thanks
I attached the labview part
03-14-2013 12:38 PM
A DLL can keep values in memory between calls. For example if the DLL declares a global variable, that space will be allocated when the DLL first loads, and any function in the DLL can access it. It's also possible for a DLL function to allocate memory and dispose of it when the call ends; it depends on the code inside the DLL.