Connecting Tech Pros Worldwide Forums | Help | Site Map

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

pachanga
Guest
 
Posts: n/a
#1: Jul 23 '05
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?


Victor Bazarov
Guest
 
Posts: n/a
#2: Jul 23 '05

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


"pachanga" <quakepapi@yahoo.com> wrote...[color=blue]
> 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?[/color]

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


EventHelix.com
Guest
 
Posts: n/a
#3: Jul 23 '05

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


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
--
http://www.EventHelix.com/EventStudio
EventStudio 2.5 - Generate Sequence Diagrams from plain text input

Ioannis Vranos
Guest
 
Posts: n/a
#4: Jul 23 '05

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


EventHelix.com wrote:[color=blue]
> 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.[/color]


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




--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jack Klein
Guest
 
Posts: n/a
#5: Jul 23 '05

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


On Fri, 24 Dec 2004 06:35:57 +0200, Ioannis Vranos
<ivr@remove.this.grad.com> wrote in comp.lang.c++:
[color=blue]
> EventHelix.com wrote:[color=green]
> > 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.[/color]
>
>
> C++/CLI *is* an upcoming standard.[/color]

Yes, but not a C++ language standard. So it is still off-topic here.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
pachanga
Guest
 
Posts: n/a
#6: Jul 23 '05

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


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

Dave O'Hearn
Guest
 
Posts: n/a
#7: Jul 23 '05

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


pachanga wrote:[color=blue]
> The funny thing about garbage collector is that that was the
> main issues about C# vs C++..[/color]

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...

--
Dave O'Hearn

jd
Guest
 
Posts: n/a
#8: Jul 23 '05

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


Le Fri, 24 Dec 2004 10:29:25 -0800, Dave O'Hearn a écrit*:
[color=blue]
> pachanga wrote:[color=green]
>> The funny thing about garbage collector is that that was the
>> main issues about C# vs C++..[/color]
>
> 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...[/color]

C++ is not Java, neither C#. If you want garbage collection
just write one for you !
Major_Small
Guest
 
Posts: n/a
#9: Jul 23 '05

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


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...

Ioannis Vranos
Guest
 
Posts: n/a
#10: Jul 23 '05

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


pachanga wrote:
[color=blue]
> The funny thing about garbage collector is that that was the main
> issues about C# vs C++..[/color]


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/Tech...V333_Sutte.ppt


http://www.accu.org/conference/prese...keynote%29.pdf



Also check this new article:

http://msdn.microsoft.com/msdnmag/is...s/default.aspx



And a page of mine:

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




--
Ioannis Vranos

http://www23.brinkster.com/noicys
Stephen Howe
Guest
 
Posts: n/a
#11: Jul 23 '05

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


> The Hans-Boehm garbage collector can be successfully used with C and[color=blue]
> C++, but not yet a standard for C++..[/color]

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


Closed Thread