[m-rev.] for review: work around bug in reusing memory zones

Zoltan Somogyi zs at csse.unimelb.edu.au
Mon Dec 4 19:10:08 AEDT 2006


On 01-Dec-2006, Peter Wang <wangp at students.csse.unimelb.edu.au> wrote:
> runtime/mercury_memory_zones.c:
> 	Add MR_dealloc_zone_memory() functions to free memory zones.
> 
> 	Work around the problem above by freeing memory zones when they
> 	are not needed instead of putting them on the free list.
> 
> I didn't test all the variants of MR_dealloc_zone_memory.

The idea is fine. I'd rather you you chose between the old and new code
not with "if (1)", but with #ifdef/#else/#endif.

> @@ -484,6 +539,9 @@ MR_construct_zone(const char *name, int 
>      zone->MR_zone_handler = handler;
>  #endif /* MR_CHECK_OVERFLOW_VIA_MPROTECT */
>  
> +    /*
> +    ** XXX this causes a memory leak if `zone' was not newly allocated.
> +    */
>      zone->MR_zone_bottom = base;

I don't understand this; please expand the comment.

Zoltan.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list