[m-dev.] Reorganization of mercury_memory.c

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Apr 27 20:54:27 AEST 1998


On 27-Apr-1998, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> I need to modify mercury_memory.c to implement accurate GC, but it's a
> bit of a mess (so much conditional compilation) so I'm going to
> reorganize it into:
> 	mercury_memory_zones.{c,h}	
> 		The MemoryZone data type and functions
> 	mercury_memory_handlers.{c,h}	
> 		The signal handlers for seg faults, and redzones.
> 	mercury_memory.{c,h}
> 		The leftovers.

That looks OK, I guess.
What's in the leftovers?
I suppose that would be the one that knows about the particular
zones needed by the Mercury runtime, with the others all being
zone independent?

> I also plan to re-organize the conditional compilation (presently, it's
> almost impossible to change anything without a printout), and make the
> tests more feature based.

This principle is something I would very strongly encourage.

> For example, have 
> 	MR_CAN_GET_PC_AT_SIGNAL
> rather than HAVE_MPROTECT && (HAVE_SIGINFO || PC_ACCESS).

In this particular case, I think the example you chose is
perhaps misnamed: something named CAN_GET_PC_AT_SIGNAL
should not depend on HAVE_MPROTECT, should it?
Perhaps you want CAN_GET_PC_AT_SIGNAL to be true iff
HAVE_SIGINFO || PC_ACCESS, with say CHECK_OVERFLOW_VIA_MPROTECT
defined to be true iff HAVE_MPROTECT and CAN_GET_PC_AT_SIGNAL
are both defined.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list