Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Backround work by compiler/os to alloc memory (http://www.go4expert.com/forums/backround-compiler-os-alloc-memory-t23312/)

rahulonly4u 15Sep2010 11:02

Backround work by compiler/os to alloc memory
 
DearS

I want to know what background work is done by compiler/OS when i dynamically create an object .
my concern about what data structure it use to create the objects and allocate memory and when those data structures destroy can i explicitly destroy those data structures


for example
when i create a sub class object compiler create a virtual table if super class have a virtual function


Thanks and Regards
Rahul

xpi0t0s 16Sep2010 15:09

Re: Backround work by compiler/os to alloc memory
 
You only need to concern yourself with the object itself. Every new X must be matched with a delete X. If the compiler adds extra code to allocate additional structures when you call new X, it will also add extra code to deallocate those structures when you call delete X. You cannot explicitly deallocate those extra structures yourself.


All times are GMT +5.5. The time now is 03:13.