www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Garbage Collector {added my email}

reply e-4 venezolano.web.ve writes:
***********************
I'm sorry for posting again,
I forgot to write my e-mail
e-4 (at) venezolano.web.ve
***********************

Hello, i just found out about D language..

I'd like to know how does the Garbage Collector is suposed to work if there is
no VM on this new language.

Regards,

Mel

http://www.advance.com.ve/
Sep 07 2004
parent reply Ilya Minkov <minkov cs.tum.edu> writes:
It works the similar way as Boehm's Garbage Collector for C and C++, so 
you may want to look up there. It is a conservative memory scanner. All 
allocations are routed through the collector, which, when the 
application becomes short on RAM, scans through the stack, and finds 
areas allocated with it. These are scanned recursively. It marks all of 
"visible" memory areas, and the rest is freed. When freeing, a 
destructor may optionally be called, which is registered with a garbage 
collector when allocating a piece of memory - for classes it is automated.

Right now it does not even reach the efficiency of Boehm's, but there 
are plans that compiler generates special code or data to assist the 
Garbage Collector, so it may become very fast. Considerations have been 
made to move to more agressive or different forms of Garbage Collection, 
and dedicated code generation makes it possible. A VM is not a 
requierement for the garbage collector.

-eye

e-4 venezolano.web.ve schrieb:

 ***********************
 I'm sorry for posting again,
 I forgot to write my e-mail
 e-4 (at) venezolano.web.ve
 ***********************
 
 Hello, i just found out about D language..
 
 I'd like to know how does the Garbage Collector is suposed to work if there is
 no VM on this new language.
 
 Regards,
 
 Mel
 
 http://www.advance.com.ve/
Sep 08 2004
parent "Venezolano" <e-4 venezolano.web.ve> writes:
Thanx, It was very helpfull... I wasn't familiar with Boehm's Garbage
Collector but I found some pretty good info about it. I had more experience
with Java and other high level programming languages like VB o VFP.

I noted that to implement Boehm's Garbage Collector, we have to include and
implement some code, that's why I asked about the VM... In Java the VM takes
care of Garbage Collection.

Melvin D. Nava
http://www.advance.com.ve/


"Ilya Minkov" <minkov cs.tum.edu> escribió en el mensaje
news:chn3ps$qfd$1 digitaldaemon.com...
 It works the similar way as Boehm's Garbage Collector for C and C++, so
 you may want to look up there. It is a conservative memory scanner. All
 allocations are routed through the collector, which, when the
 application becomes short on RAM, scans through the stack, and finds
 areas allocated with it. These are scanned recursively. It marks all of
 "visible" memory areas, and the rest is freed. When freeing, a
 destructor may optionally be called, which is registered with a garbage
 collector when allocating a piece of memory - for classes it is automated.

 Right now it does not even reach the efficiency of Boehm's, but there
 are plans that compiler generates special code or data to assist the
 Garbage Collector, so it may become very fast. Considerations have been
 made to move to more agressive or different forms of Garbage Collection,
 and dedicated code generation makes it possible. A VM is not a
 requierement for the garbage collector.

 -eye

 e-4 venezolano.web.ve schrieb:

 ***********************
 I'm sorry for posting again,
 I forgot to write my e-mail
 e-4 (at) venezolano.web.ve
 ***********************

 Hello, i just found out about D language..

 I'd like to know how does the Garbage Collector is suposed to work if
there is
 no VM on this new language.

 Regards,

 Mel

 http://www.advance.com.ve/
Sep 13 2004