[m-rev.] LLDS accurate GC improvements

Zoltan Somogyi zs at cs.mu.OZ.AU
Thu Oct 23 11:39:58 AEST 2003


On 22-Oct-2003, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> +    /* Reset the redzone on the new heap */
> +    {
> +      /* These counts include some wasted space between ->min and ->bottom. */
> +      size_t old_heap_space =
> +	      	(char *) old_heap->redzone_base - (char *) old_heap->bottom;
> +      size_t new_heap_usage =
> +	      	(char *) MR_virtual_hp - (char *) new_heap->bottom;
> +      size_t gc_heap_size;
> +
> +      /*
> +      ** Set the size at which to GC to be MR_heap_expansion_factor
> +      ** (which defaults to two) times the current usage,
> +      ** or the size at which we GC'd last time, whichever is larger.
> +      */
> +      gc_heap_size = (size_t) (MR_heap_expansion_factor * new_heap_usage);
> +      if (gc_heap_size < old_heap_space) {
> +	      gc_heap_size = old_heap_space;
> +      }
> +      old_heap->redzone_base = (MR_Word *)
> +	      	((char *) old_heap->bottom + gc_heap_size);
> +      MR_reset_redzone(old_heap);
> +    }
>  
>      if (MR_agc_debug) {
>          fprintf(stderr, "garbage_collect() done.\n\n");

The indentation here doesn't look consistent.

>  #ifdef MR_DEBUG_AGC_SMALL_HEAP
>    size_t	MR_heap_size =			  52;
>  #else
> -  size_t	MR_heap_size =			4096;
> +  size_t	MR_heap_size =		       32768; /* 16 Mb */
>  #endif

That comment looks incorrect ...

> +/*
> +** size of the redzones at the end of data areas, in kilobytes
> +**
> +** For accurate GC, although we start out with a big heap (32 Mb -- see above),
> +** we don't want to touch all of it unless we really need to.

That line wraps.

Zoltan.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list