By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,507 Members | 1,758 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,507 IT Pros & Developers. It's quick & easy.

Garbage collector in C#

P: n/a
Alllo,

Sory I' cant find news group for C#.
And my question is how is posible to implement
a grbage collectoe in language that have pointers.
When you put some adres in way like c = &p,
where c is a pointer on object that is instance
of some classe, so that garbage collector can work
you must programably analyze complete source
code, that s realy imposible to make a priogram
of this level of intelligence.
Maybye this is not wrong group becouse I hearded
that exists a grbage collector for C++.

Thanks in advance !
ro***********@si.htnet.hr
Jul 22 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
ms.public.dotnet.lang.csharp

"Robert Bralic" <ro***********@si.htnet.hr> дʼ
news:ch**********@ls219.htnet.hr...
Alllo,

Sory I' cant find news group for C#.
And my question is how is posible to implement
a grbage collectoe in language that have pointers.
When you put some adres in way like c = &p,
where c is a pointer on object that is instance
of some classe, so that garbage collector can work
you must programably analyze complete source
code, that s realy imposible to make a priogram
of this level of intelligence.
Maybye this is not wrong group becouse I hearded
that exists a grbage collector for C++.

Thanks in advance !
ro***********@si.htnet.hr

Jul 22 '05 #2

P: n/a
Robert Bralic wrote:
Alllo,

Sory I' cant find news group for C#.
And my question is how is posible to implement
a grbage collectoe in language that have pointers.
When you put some adres in way like c = &p,
where c is a pointer on object that is instance
of some classe, so that garbage collector can work
you must programably analyze complete source
code, that s realy imposible to make a priogram
of this level of intelligence.
Maybye this is not wrong group becouse I hearded
that exists a grbage collector for C++.


Well, there is the Boehm GC for C and C++.
See http://www.hpl.hp.com/personal/Hans_Boehm/gc/
Jul 22 '05 #3

P: n/a
Robert Bralic wrote:
And my question is how is posible to implement
a grbage collectoe in language that have pointers.


In short, it's not, if pointers are unrestricted as in C or C++, for
several reasons, but mostly because pointers can be computed in
arbitrary ways from stored integers. It's provably impossible for any GC
scheme to detect all such "hidden" pointers.

On the other hand, people do this so rarely, and even when they do it in
such a small number of common ways, that an ordinary garbage collector
does a pretty good job on your average C or C++ program. After all,
leaking memory really slowly isn't so bad, particularly in applications
that don't run for months.
--
Derrick Coetzee
I grant this newsgroup posting into the public domain. I disclaim all
express or implied warranty and all liability. I am not a professional.
Jul 22 '05 #4

P: n/a

"Dany Zhang" <zh******@liming.com> wrote in message
news:ch***********@mail.cn99.com...
"Robert Bralic" <ro***********@si.htnet.hr> дʼ
news:ch**********@ls219.htnet.hr...
Alllo,

Sory I' cant find news group for C#.


ms.public.dotnet.lang.csharp


microsoft.public.dotnet.languages.csharp
microsoft.public.dotnet.csharp.general
Jul 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.