How to clear dynamic memory? -


for example, have dynamic segment tree on pointers, memory clear if assign root of tree null? how clear efiiciently?

assigning null change pointer's address, won't affect allocated memory. deallocation shall conform allocation. means if have allocated each inode of tree separately, need deallocate them separately (most in reverse order - depends on content of chunks). if memory allocated @ once, should deallocated @ once.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -