can garbeg collector be assisted by compiler

Discussion in 'C++' started by mangesh, Jul 7, 2006.

  1. mangesh

    mangesh Guest

    Garbage collection is done at runtime .Then how compiler can assist it.
    Compiler plays no role at runtime . It is stated so on link
    "http://www.iecc.com/gclist/GC-faq.html#Common%20questions" .

    Regards ,
    Mangesh .
    mangesh, Jul 7, 2006
    #1
    1. Advertising

  2. mangesh

    mlimber Guest

    Re: can garbeg collector be assisted by compiler

    mangesh wrote:
    > Garbage collection is done at runtime .Then how compiler can assist it.
    > Compiler plays no role at runtime . It is stated so on link
    > "http://www.iecc.com/gclist/GC-faq.html#Common%20questions" .


    The full quote reads: "Garbage collection is a part of a language's
    runtime system, or an add-on library, perhaps assisted by the compiler,
    the hardware, the OS, or any combination of the three, that
    automatically determines what memory a program is no longer using, and
    recycles it for other use. It is also known as 'automatic storage (or
    memory) reclamation'."

    Any compiler that helps (e.g., by inserting some extra code here or
    there to help in GC) is outside the current C++ Standard on this point,
    though "C++0x will most likely support optional garbage collection"
    (http://www.artima.com/cppsource/cpp0x.html).

    Cheers! --M
    mlimber, Jul 7, 2006
    #2
    1. Advertising

  3. mangesh

    Jerry Coffin Guest

    In article <>,
    says...
    > Garbage collection is done at runtime .Then how compiler can assist it.
    > Compiler plays no role at runtime . It is stated so on link
    > "http://www.iecc.com/gclist/GC-faq.html#Common%20questions" .


    The compiler itself plays no role at runtime (in the traditional
    compiler model) but that's more or less irrelevant. The compiler can
    do things like ensuring that (at runtime) the garbage collector can
    figure out what's a pointer vs. some other value that might happen to
    look like a pointer.

    Some concurrent garbage collectors also require reduced access to
    data at particular times. They might (for example) allow data to be
    read, but not modified while garbage collection is taking place. Such
    a write barrier nearly always needs at least some support from the
    compiler. Likewise, there are other forms of GC that require a read
    barrier at times.

    --
    Later,
    Jerry.

    The universe is a figment of its own imagination.
    Jerry Coffin, Jul 7, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Tillie

    Garbage Collector Debugging

    Rob Tillie, Aug 15, 2003, in forum: ASP .Net
    Replies:
    11
    Views:
    1,738
    JerryK
    Aug 18, 2003
  2. Jack Wright
    Replies:
    5
    Views:
    611
    Shiv Kumar
    Jan 19, 2004
  3. Pyramis
    Replies:
    0
    Views:
    387
    Pyramis
    Jan 25, 2004
  4. Colt

    Garbage collector problem

    Colt, Nov 15, 2003, in forum: Java
    Replies:
    9
    Views:
    668
    Tim Ward
    Nov 18, 2003
  5. bart59
    Replies:
    0
    Views:
    489
    bart59
    Jun 17, 2004
Loading...

Share This Page