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
Post a Comment