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

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

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -