how to free memory space for 2 dimension ?
-
float **deviation1;
deviation1=memory_alloc_2D(waveframesize,NUM_OF_COEFFICIENTS);for(i=0;i
I am trying to free the memory space of deviation but it seem not working cause the process is killed and while checking the running process for every loop the memory size is incremented..can someone suggest where i wen wrong?
-
float **deviation1;
deviation1=memory_alloc_2D(waveframesize,NUM_OF_COEFFICIENTS);for(i=0;i
I am trying to free the memory space of deviation but it seem not working cause the process is killed and while checking the running process for every loop the memory size is incremented..can someone suggest where i wen wrong?
You should show us the source of your memory_alloc_2D function. In general it is better to free the most recently allocated memory first. That means the loop in your
freeArray
function should start atm-1
and decrement the loop variable until null. -
float **deviation1;
deviation1=memory_alloc_2D(waveframesize,NUM_OF_COEFFICIENTS);for(i=0;i
I am trying to free the memory space of deviation but it seem not working cause the process is killed and while checking the running process for every loop the memory size is incremented..can someone suggest where i wen wrong?
mybm1 wrote:
memory_alloc_2D
This is not a standard call... which usually means you shouldn't use a standard call to free the allocation. If this is from a library that you're using, it likely also has a corresponding "free_2D" call (guessing on the name).