Re: Implemenation of Global Variables
- From: Joachim Schimpf <j.schimpf@xxxxxxxxxxxxxxx>
- Date: Wed, 22 Nov 2006 18:18:21 GMT
bart demoen wrote:
#define noye_trail(loc,bh,trreg,newval) \If newval is already at a location >= bh, you don't need
if (loc >= bh) \
*loc = newval; \
else \
{ if (!is_ref(*loc) || (*loc) < bh)) \
{ *trreg++ = *loc; /* old value */ \
*trreg++ = loc; /* location */ \
} \
*loc = hreg; \
*hreg = newval; \
hreg++; \
}
to create the extra indirection.
True. But my deref doesn't remember the location: it is pure tag on
pointer WAM style, so there there is no a need to remember the
location in the common circumstances. Variable shunting will get rid of
the unnecessary indirection at some point :-)
I was thinking of the case where newval is a list,
structure, boxed constant on the heap etc.
-- Joachim
.
- References:
- Implemenation of Global Variables
- From: andy . bartholomew
- Re: Implemenation of Global Variables
- From: bart demoen
- Re: Implemenation of Global Variables
- From: Neng-Fa Zhou
- Re: Implemenation of Global Variables
- From: bart demoen
- Re: Implemenation of Global Variables
- From: Joachim Schimpf
- Re: Implemenation of Global Variables
- From: bart demoen
- Implemenation of Global Variables
- Prev by Date: Re: Implemenation of Global Variables
- Next by Date: Re: The n-knights problem
- Previous by thread: Re: Implemenation of Global Variables
- Next by thread: Re: Implemenation of Global Variables
- Index(es):
Relevant Pages
|
|