emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r114593: * lisp.h (eassert): Don't use 'assume'.


From: Paul Eggert
Subject: [Emacs-diffs] trunk r114593: * lisp.h (eassert): Don't use 'assume'.
Date: Wed, 09 Oct 2013 17:52:43 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114593
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Wed 2013-10-09 10:52:38 -0700
message:
  * lisp.h (eassert): Don't use 'assume'.
  
  Sometimes 'assume' wins in performance, and sometimes it loses,
  so it shouldn't be used all the time.  Perhaps we need two
  flavors of 'eassert', one for where 'assume' is far more likely
  to help or to hurt; but that can be done later.
  Problem reported by Dmitry Andipov in
  <http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00276.html>.
  Also, don't include <verify.h>; no longer needed.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/lisp.h                     lisp.h-20091113204419-o5vbwnq5f7feedwu-253
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-10-09 17:17:20 +0000
+++ b/src/ChangeLog     2013-10-09 17:52:38 +0000
@@ -1,3 +1,14 @@
+2013-10-09  Paul Eggert  <address@hidden>
+
+       * lisp.h (eassert): Don't use 'assume'.
+       Sometimes 'assume' wins in performance, and sometimes it loses,
+       so it shouldn't be used all the time.  Perhaps we need two
+       flavors of 'eassert', one for where 'assume' is far more likely
+       to help or to hurt; but that can be done later.
+       Problem reported by Dmitry Andipov in
+       <http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00276.html>.
+       Also, don't include <verify.h>; no longer needed.
+
 2013-10-09  Glenn Morris  <address@hidden>
 
        * eval.c (Fcond): Doc tweak.

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2013-10-08 20:04:40 +0000
+++ b/src/lisp.h        2013-10-09 17:52:38 +0000
@@ -31,7 +31,6 @@
 #include <limits.h>
 
 #include <intprops.h>
-#include <verify.h>
 
 INLINE_HEADER_BEGIN
 
@@ -115,11 +114,9 @@
 /* Extra internal type checking?  */
 
 /* Define an Emacs version of 'assert (COND)'.  COND should be free of
-   side effects; it may be evaluated zero or more times.  If COND is false,
-   Emacs reliably crashes if ENABLE_CHECKING is defined and behavior
-   is undefined if not.  The compiler may assume COND while optimizing.  */
+   side effects; it may be evaluated zero or more times.  */
 #ifndef ENABLE_CHECKING
-# define eassert(cond) assume (cond)
+# define eassert(cond) ((void) (0 && (cond))) /* Check that COND compiles.  */
 #else /* ENABLE_CHECKING */
 
 extern _Noreturn void die (const char *, const char *, int);
@@ -136,7 +133,7 @@
 
 # define eassert(cond)                                         \
    (suppress_checking || (cond)                                \
-    ? assume (cond)                                            \
+    ? (void) 0                                                 \
     : die (# cond, __FILE__, __LINE__))
 #endif /* ENABLE_CHECKING */
 


reply via email to

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