When is garbage collector for C++ is going to be a standard?

P

pachanga

The Hans-Boehm garbage collector can be successfully used with C and
C++, but not yet a standard for C++.. Is there talks about Garbage
Collector to become in the C++ standard?
 
V

Victor Bazarov

pachanga said:
The Hans-Boehm garbage collector can be successfully used with C and
C++, but not yet a standard for C++.. Is there talks about Garbage
Collector to become in the C++ standard?

Not AFAIK. Try asking in comp.std.c++, they discuss the Standard as
it is or as it will be.
 
E

EventHelix.com

Microsoft has C++/CLI. It allows you to use the gcnew keyword
to allocate garbage collected memory.

I hope they standardize it just like the CLI and C# language.

Deepa
 
I

Ioannis Vranos

EventHelix.com said:
Microsoft has C++/CLI. It allows you to use the gcnew keyword
to allocate garbage collected memory.

I hope they standardize it just like the CLI and C# language.


C++/CLI *is* an upcoming standard.
 
P

pachanga

The funny thing about garbage collector is that that was the main
issues about C# vs C++..
 
D

Dave O'Hearn

pachanga said:
The funny thing about garbage collector is that that was the
main issues about C# vs C++..

Yes, well if you want to whine that you won't use C++ if it doesn't
mandate GC, and as a result the entire world will end, you have chosen
the wrong newsgroup.

If you simply want GC though, you could use the Hans-Boehm collector.
That sounds more productive...
 
J

jd

Le Fri, 24 Dec 2004 10:29:25 -0800, Dave O'Hearn a écrit :
Yes, well if you want to whine that you won't use C++ if it doesn't
mandate GC, and as a result the entire world will end, you have chosen
the wrong newsgroup.

If you simply want GC though, you could use the Hans-Boehm collector.
That sounds more productive...

C++ is not Java, neither C#. If you want garbage collection
just write one for you !
 
M

Major_Small

where is the big problem in picking up after yourself? I agree that
sometimes it's fun to just create new objects all the time, but not
having garbage collection doesn't seem like a big deal to me... as long
as you know what you're doing...
 
I

Ioannis Vranos

pachanga said:
The funny thing about garbage collector is that that was the main
issues about C# vs C++..


That is wrong (in other words a hoax). For example here is what has been
written in TC++PL on this matter (since 1997):


"C.9.1 Automatic Garbage Collection

When this regular approach isn’t sufficient, the programmer might use a
memory manager that finds unreferenced objects and reclaims their memory
in which to store new objects. This is usually called automatic garbage
collection, or simply garbage collection. Naturally, such a memory
manager is called a garbage collector.

The fundamental idea of garbage collection is that an object that is no
longer referred to in a program will not be accessed again, so its
memory can be safely reused for some new object. For example:

void f()
{
int* p = new int;

p = 0;

char* q = new char;
}

Here, the assignment p=0 makes the int unreferenced so that its memory
can be used for some other new object. Thus, the char might be allocated
in the same memory as the int so that q holds the value that p
originally had.

The standard does not require that an implementation supply a garbage
collector, but garbage collectors are increasingly used for C++ in areas
where their costs compare favorably to those of manual management of
free store. When comparing costs, consider the run time, memory usage,
reliability, portability, monetary cost of programming, monetary cost of
a garbage collector, and predictability of performance."





That aside, .NET's garbage collector (and more generally the CLI's), is
available to all the languages using it and not of C#, so you can write
C++ .NET garbage collected applications since VS 2002.

In other words the GC is not part of C#, but of CLI.



Also in .NET 2.0 and afterwards (and with the upcoming C++/CLI), C++
becomes the systems programming language of .NET (and CLI).


Some references mentioning why C++ becomes the systems programming
language of .NET and why it is better:


http://microsoft.sitestream.com/TechEd/DEV/DEV333_files/Botto_files/DEV333_Sutte.ppt


http://www.accu.org/conference/pres...Relevant_on_Modern_Environments_(keynote).pdf



Also check this new article:

http://msdn.microsoft.com/msdnmag/issues/05/01/COptimizations/default.aspx



And a page of mine:

http://www23.brinkster.com/noicys/cppcli.htm
 
S

Stephen Howe

The Hans-Boehm garbage collector can be successfully used with C and
C++, but not yet a standard for C++..

Do you mean optional standard?

If yes, write a serious proposal and put it to the standards committee.

If no, then LOL, it will never get off the ground. It would break every
existing C++ program.

Stephen Howe
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,245
Latest member
Evelyne64L

Latest Threads

Top