LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

"dynamic memory"

Hello,
 
I have a dynamically allocated array. This array is of structure type. I have a conditional check to verify whether each element of this array was allocated with memory before performing further actions. I have palced the source code below.
 
Initially "ParaStructArray" is allocated with defined array size
ParaStructArray = (T_Data*) calloc(arraysize, sizeof(T_Data));
 
Later in one of my functions I have the validation check like this
 if(&ParaStructArray[iVal] != NULL)
 {
.... do something....
}
where iVal can range between 0 to arraysize.
In this case the validation passes if iVal is -1 or > arraysize and also in case if the ParaStructArray was freed.
 
Can I know whether there exists any function similar to _msize available in Borland compiler which can return me the information on the memory size in case of LabWindows/CVI? I would like to have memory size information of only a particular variable. Is there any other method I could use to overcome the problem?
 


Message Edited by Sreekantha on 01-15-2008 11:48 PM
0 Kudos
Message 1 of 2
(2,739 Views)
Hi Sreekantha,

There is no C function that has the same functionality, and there are no similar functions within LabWindows/CVI  that are public to its API.

Hope this helps!



Evan Prothro
RF Systems Engineer | NI

0 Kudos
Message 2 of 2
(2,702 Views)