garbage collector c++

Discussion in 'C++' started by Charles T., Aug 19, 2005.

  1. Charles T.

    Charles T. Guest

    Hi,

    looking for advance article/books on garbage-collected allocation.

    thanks, Charles.
     
    Charles T., Aug 19, 2005
    #1
    1. Advertising

  2. Charles T.

    Frank Chang Guest

    Charles, Which compiler are you using gcc or Microsoft Visual
    Studio.net 2003 or Microsoft Visual Studio.net 2005? .NET 2005 allows
    the programmer to create objects that are swept away by the .NET
    garbage collector. Unix gcc also has garbage collection. Each compiler
    uses different types of garbage collection algorithms. But these
    garbage collection alogorithms will not prevent all memory leaks. I
    would recommend first reading about the general concepts of garbage
    collection independent of the language (C++,Java/Scheme, etc).
     
    Frank Chang, Aug 19, 2005
    #2
    1. Advertising

  3. Charles T.

    Frank Chang Guest

    Charles, I should preface my earlier comments about Visual Studio .NET
    2005 garbage collection by saying this only applies to managed C++
    which is used by the .NET CLR. For unmanaged C++ code, it is still best
    to define and implement C++ destructors.
     
    Frank Chang, Aug 19, 2005
    #3
  4. Charles T.

    Vijai Kalyan Guest

    Vijai Kalyan, Aug 20, 2005
    #4
  5. Charles T.

    Dan Cernat Guest

    "Frank Chang" <> wrote in message
    news:...
    > Charles, I should preface my earlier comments about Visual Studio .NET
    > 2005 garbage collection by saying this only applies to managed C++
    > which is used by the .NET CLR. For unmanaged C++ code, it is still best
    > to define and implement C++ destructors.
    >


    How would a C++ destructor help in the program below?

    int main()
    {
    char* myArray = new char[100];

    // delete[] my array; // commented out
    return 0;
    }

    Duh!

    dan
     
    Dan Cernat, Aug 22, 2005
    #5
    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,764
    JerryK
    Aug 18, 2003
  2. Pyramis
    Replies:
    0
    Views:
    403
    Pyramis
    Jan 25, 2004
  3. Colt

    Garbage collector problem

    Colt, Nov 15, 2003, in forum: Java
    Replies:
    9
    Views:
    689
    Tim Ward
    Nov 18, 2003
  4. bart59
    Replies:
    0
    Views:
    503
    bart59
    Jun 17, 2004
  5. Will Hartung

    Garbage Collector Tuning?

    Will Hartung, Sep 8, 2004, in forum: Java
    Replies:
    3
    Views:
    2,097
    Kevin McMurtrie
    Sep 11, 2004
Loading...

Share This Page