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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -