emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 366c1ce: Improve clarity of USE_LSB_TAG definition.


From: Paul Eggert
Subject: [Emacs-diffs] master 366c1ce: Improve clarity of USE_LSB_TAG definition.
Date: Sat, 29 Nov 2014 07:39:14 +0000

branch: master
commit 366c1ceb038b42ed8590486e1a3c3cebba87e9da
Author: Paul Eggert <address@hidden>
Date:   Fri Nov 28 23:38:41 2014 -0800

    Improve clarity of USE_LSB_TAG definition.
    
    Problem reported by Lee Duhem.  Suggestion by Andreas Schwab in:
    http://lists.gnu.org/archive/html/emacs-devel/2014-11/msg02222.html
    * lisp.h (USE_LSB_TAG): Define in terms of the (simpler)
    VAL_MAX / 2 rather than in terms of the (more complicated)
    EMACS_INT_MAX >> GCTYPEBITS, and adjust commentary to match.
---
 src/ChangeLog |    9 +++++++++
 src/lisp.h    |    7 ++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index ed111bf..53834ed 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2014-11-29  Paul Eggert  <address@hidden>
+
+       Improve clarity of USE_LSB_TAG definition.
+       Problem reported by Lee Duhem.  Suggestion by Andreas Schwab in:
+       http://lists.gnu.org/archive/html/emacs-devel/2014-11/msg02222.html
+       * lisp.h (USE_LSB_TAG): Define in terms of the (simpler)
+       VAL_MAX / 2 rather than in terms of the (more complicated)
+       EMACS_INT_MAX >> GCTYPEBITS, and adjust commentary to match.
+
 2014-11-29  Eli Zaretskii  <address@hidden>
 
        * xdisp.c (handle_single_display_spec): When ignoring a fringe
diff --git a/src/lisp.h b/src/lisp.h
index bdff019..42bb337 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -257,16 +257,17 @@ enum Lisp_Bits
 
 /* The maximum value that can be stored in a EMACS_INT, assuming all
    bits other than the type bits contribute to a nonnegative signed value.
-   This can be used in #if, e.g., '#if VAL_MAX < UINTPTR_MAX' below.  */
+   This can be used in #if, e.g., '#if USB_TAG' below expands to an
+   expression involving VAL_MAX.  */
 #define VAL_MAX (EMACS_INT_MAX >> (GCTYPEBITS - 1))
 
 /* Whether the least-significant bits of an EMACS_INT contain the tag.
-   On hosts where pointers-as-ints do not exceed VAL_MAX, USE_LSB_TAG is:
+   On hosts where pointers-as-ints do not exceed VAL_MAX / 2, USE_LSB_TAG is:
     a. unnecessary, because the top bits of an EMACS_INT are unused, and
     b. slower, because it typically requires extra masking.
    So, USE_LSB_TAG is true only on hosts where it might be useful.  */
 DEFINE_GDB_SYMBOL_BEGIN (bool, USE_LSB_TAG)
-#define USE_LSB_TAG (EMACS_INT_MAX >> GCTYPEBITS < INTPTR_MAX)
+#define USE_LSB_TAG (VAL_MAX / 2 < INTPTR_MAX)
 DEFINE_GDB_SYMBOL_END (USE_LSB_TAG)
 
 #if !USE_LSB_TAG && !defined WIDE_EMACS_INT



reply via email to

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