[Top][All Lists]

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

Re: tags in the 3 lowest bits

From: Stefan Monnier
Subject: Re: tags in the 3 lowest bits
Date: 20 Nov 2003 00:14:07 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> The only reason I can see for this is that there is a small
> performance penalty on XFASTINT with LSB -- but I'd prefer that
> penalty rather than having to support two different methods.

I doubt the performance penalty is an issue.  After all, manipulating MSB
is generally slightly more costly than LSB, so the performance impact might
even be positive.  But I expect it's a wash.

> Or are there systems which cannot use LSB?

The LSB code needs pointers values that are multiples of 8.
On some systems, malloc does not guarantee it.  Probably we can use
gmalloc.c for those systems, but we'll need to make sure that's an option
and we'll need to figure out when that's nmecessary.  Also, there might be
systems that are word-addressed rather than byte-addressed.  I don't know
if such systems are still in use and whether Emacs runs on them, but if
yes, we'll probably need to find some other way to deal with them,
maybe keeping the old behavior.

I also hope we can switch to LSB everywhere, but I don't think we can
do that right now.

I suggest to start with something like along the lines of

#if defined GLIBC || defined GNU_MALLOC
#define USE_LSB_TAG

And then slowly increase the number of systems where we use LSB.

Basically, the same as is/was done for the conservative stack marking (that
was recently turned on in MacOS).

BTW, the patch has only seen fairly light testing.  It works for me
with PCL-CVS, Gnus, and bunch of other things but there might still be
bugs lurking.  I strongly suggest to run it with ENABLE_CHECKING (which my
patch decouples from NO_UNION_TYPE).


reply via email to

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