From: | Tom I Helbekkmo <tih(at)Hamartun(dot)Priv(dot)NO> |
---|---|
To: | Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | scrappy(at)hub(dot)org, goran(at)bildbasen(dot)se, hackers(at)postgreSQL(dot)org |
Subject: | Re: [HACKERS] configure on linux |
Date: | 1998-02-05 04:21:12 |
Message-ID: | 980205045500.7956A@barsoom.Hamartun.Priv.NO |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, 4 Feb 1998, Bruce Momjian wrote:
> Yes, I considered static functions, but that is assuming the compiler is
> going to do something, and we can't really be sure of this. Better to
> make it a macro, so there is no change of it not being inlined. Also, I
> don't think asm stuff is re-ordered, so you don't have the 'volatile'
> problem.
Good thinking. I think I'll just inline the thing down to this:
#define S_LOCK(addr) asm("1: bbssi $0,(%0),1b": :"r"(addr))
#define S_UNLOCK(addr) (*(addr) = 0)
#define S_INIT_LOCK(addr) (*(addr) = 0)
Dropping this into the (simple) test code I was using, it worked right
at all optimization levels -- but how much can the compiler manage to
screw up for me anyway, when there's just one single instruction? :-)
-tih
--
Popularity is the hallmark of mediocrity. --Niles Crane, "Frasier"
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 1998-02-05 04:27:10 | Re: [HACKERS] VACUUM ANALYZE Problem |
Previous Message | The Hermit Hacker | 1998-02-05 03:36:02 | Re: [HACKERS] Re: regression test "strings" failure. |