[Gc] Difference between version 6.3 and latest which is 6.4

Boehm, Hans hans.boehm at hp.com
Tue Jun 21 16:47:08 PDT 2005


I don't think that there is a big difference between
GC_malloc_uncollectable and GC_malloc performance, though I
haven't timed it.  GC_malloc_uncollectable memory is
effectively treated as part of the root set, unlike the
system malloc.  If you're sure it contains no pointers,
I would probably use GC_malloc_atomic_uncollectable,
though the system malloc is not a bad choice either.

Hans

> -----Original Message-----
> From: Emmanuel Stapf [ES] [mailto:manus at eiffel.com] 
> Sent: Tuesday, June 21, 2005 2:24 PM
> To: Boehm, Hans
> Cc: gc at napali.hpl.hp.com
> Subject: RE: [Gc] Difference between version 6.3 and latest 
> which is 6.4
> 
> 
> > Does Windows have a way to enumerate it?  In general it seems
> 
> I don't think so, but I'm not an expert here.
> 
> > The standard work-around is to also store a copy of the
> > pointer in some static data structure, or to allocate it with 
> > GC_malloc_uncollectable.
> 
> I've done that and it now seems to work fine. I have a 
> question. In my code I use my own wrapper of `malloc', 
> `realloc', `calloc' and `free' for the memory management of 
> data which does not contain references to other allocated 
> memory areas. Would it be better to wrap my `malloc' using 
> `GC_malloc_uncollectable' rather than `GC_malloc' so that it 
> behaves the same as the normal `malloc'. That is to say, I do 
> not want the GC to collect it, because it would be an error 
> in the way my program is written. Is this more expensive than 
> `GC_malloc', in other words would it make the gc slower by 
> having too many roots to scan?
> 
> Regards,
> Manu
> 
> 



More information about the Gc mailing list