guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gc issues


From: Michael Livshin
Subject: Re: gc issues
Date: 14 Sep 2000 00:23:16 +0300
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (20 Minutes to Nikko)

address@hidden (Carl R. Witty) writes:

> Dirk Herrmann <address@hidden> writes:
> 
> > I suggest to use an alternative macro:
> > 
> > extern volatile SCM scm_dummy;  /* never read, only written */
> > #define scm_remember_object(obj) (scm_dummy = (obj))

I'm not at all sure that writing a volatile location is cheaper than
calling an empty function with one argument.  in fact, function should
cost less, for caching reasons -- the top of the stack is always in
dcache, and `scm_remember' has a non-zero chance to be in icache.  a
store to a volatile location is supposed to force a commit.  I think.

> When compiling for gcc, you could use something like (untested):
> 
> #define scm_remember_object(obj) (asm("" : : "r"(obj)))
> 
> which basically means exactly "make sure this value is in some
> register at this point in the code".

wow.  portable assembly code!

neat, except it's probably unadvisable for ix86, since there are few
registers and `obj' might actually be on the stack and not need the
treatment at all.  (hmmm, I wonder if you can somehow test for it in
GCC -- that would be very cool).

-- 
You have a tendency to feel you are superior to most computers.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]