1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Backround work by compiler/os to alloc memory

Discussion in 'C' started by rahulonly4u, Sep 15, 2010.

  1. rahulonly4u

    rahulonly4u New Member

    Joined:
    Sep 6, 2010
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    software developer
    Location:
    india
    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
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    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.
     

Share This Page