[Gc] (no subject)
hans.boehm at hp.com
Sat Oct 23 12:28:04 PDT 2010
The collector generally does not trace from objects allocated with system malloc. Doing so is difficult without understanding the system malloc data structures. This usually means you should not store pointers to garbage-collected memory in locations allocated with the system malloc. If you have to use some manual deallocation and store GC pointers in such objects, use GC_malloc_uncollectable instead of malloc.
When you call GC_MALLOC, the memory is obtained in big chunks from the operating system, and managed entirely by the garbage collector. The collector maintains data structures that allow it to find all GC_MALLOC-allocated objects, check whether an address is inside such an object, etc. For details, see http://www.hpl.hp.com/personal/Hans_Boehm/gc/gcdescr.html .
From: gc-bounces at linux.hpl.hp.com [mailto:gc-bounces at linux.hpl.hp.com] On Behalf Of daksha yadav
Sent: Saturday, October 23, 2010 9:19 AM
To: gc at linux.hpl.hp.com
Subject: [Gc] (no subject)
I have a very basic doubt. We know that malloc gets memory from the heap. So how can we scan the heap memory for the checking whether a particular object is live or not, i.e how can we get the highest and lowest address of the heap.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Gc