ratpoison-devel
[Top][All Lists]
Advanced

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

Re: [RP] cleaning event handler


From: Jonathan Walther
Subject: Re: [RP] cleaning event handler
Date: Fri, 20 Apr 2001 10:07:46 -0700 (PDT)

-----BEGIN PGP SIGNED MESSAGE-----

Ok, let me put this in different words.  The way the compiler currently works,
if you declare a variable as "register", theres a whole host of optimizations
that can't be done with regard to it.  Whether or not it actually goes into the
register, the compiler has to treat it specially.  Unless thats changed *very*
recently, thats still the way it is.  Theres a reason you don't see it used
much in the Linux kernel source, where you would expect to see it all over
the place.  GNU compiler currently just ignores register directive on x86 
machines
anyway, but still treats the var with kid gloves.

On Fri, 20 Apr 2001 address@hidden wrote:
> >I could be wrong on this, but I was always tought in school that using
> >"register" keyword made a variable off-limits for optimizations.  Plus
> >it doesn't even gaurantee that the variable will be stuffed in a register
> >in the first place; its just a hint.  Have you benchmarked the two
> >different ways and found a difference?  Less code, more code?  Faster,
> >slower?
> 
> Its from the GNU libc manual. volatile is the keyword that tells the compiler 
> the
> variable will be doing some harsh-wack stuff and it should stay away from it. 
> register tells the compiler to put the variable in a register if it can.

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: noconv

iQCVAwUBOuBs48K9HT/YfGeBAQFCIwP/bfPDCH7c7xY4fcpIY7RCaB7i+i94BLhu
6UzAy+GjQsNwxL1KnVZ7XO0bXQPOXDFUWaJvngkm8tYZohbF+v+nrp2RdgTrqKa4
RkT0CoreKeL6amVbgX6KcqmfNI5yiuJGT1qOfqbVnH9Flg/IL33AxYtYPKYUIKzl
ArcHCwlXrJQ=
=6KAE
-----END PGP SIGNATURE-----




reply via email to

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