emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109473: Use GCALIGNMENT where approp


From: Dmitry Antipov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109473: Use GCALIGNMENT where appropriate.
Date: Mon, 06 Aug 2012 20:55:46 +0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109473
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Mon 2012-08-06 20:55:46 +0400
message:
  Use GCALIGNMENT where appropriate.
  * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
  (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
  (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
modified:
  src/ChangeLog
  src/alloc.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-08-06 16:36:47 +0000
+++ b/src/ChangeLog     2012-08-06 16:55:46 +0000
@@ -1,3 +1,10 @@
+2012-08-06  Dmitry Antipov  <address@hidden>
+
+       Use GCALIGNMENT where appropriate.
+       * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
+       (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
+       (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
+
 2012-08-06  Eli Zaretskii  <address@hidden>
 
        * w32menu.c (set_frame_menubar, initialize_frame_menubar): Don't

=== modified file 'src/alloc.c'
--- a/src/alloc.c       2012-08-06 10:24:26 +0000
+++ b/src/alloc.c       2012-08-06 16:55:46 +0000
@@ -521,7 +521,7 @@
 
 #if USE_LSB_TAG
 # define XMALLOC_HEADER_ALIGNMENT \
-    COMMON_MULTIPLE (1 << GCTYPEBITS, XMALLOC_BASE_ALIGNMENT)
+    COMMON_MULTIPLE (GCALIGNMENT, XMALLOC_BASE_ALIGNMENT)
 #else
 # define XMALLOC_HEADER_ALIGNMENT XMALLOC_BASE_ALIGNMENT
 #endif
@@ -2902,8 +2902,7 @@
 /* Align allocation request sizes to be a multiple of ROUNDUP_SIZE.  */
 enum
   {
-    roundup_size = COMMON_MULTIPLE (word_size,
-                                   USE_LSB_TAG ? 1 << GCTYPEBITS : 1)
+    roundup_size = COMMON_MULTIPLE (word_size, USE_LSB_TAG ? GCALIGNMENT : 1)
   };
 
 /* ROUNDUP_SIZE must be a power of 2.  */
@@ -3457,8 +3456,8 @@
 {
   struct Lisp_Symbol s;
 #if USE_LSB_TAG
-  unsigned char c[(sizeof (struct Lisp_Symbol) + (1 << GCTYPEBITS) - 1)
-                 & -(1 << GCTYPEBITS)];
+  unsigned char c[(sizeof (struct Lisp_Symbol) + GCALIGNMENT - 1)
+                 & -GCALIGNMENT];
 #endif
 };
 
@@ -3552,8 +3551,8 @@
 {
   union Lisp_Misc m;
 #if USE_LSB_TAG
-  unsigned char c[(sizeof (union Lisp_Misc) + (1 << GCTYPEBITS) - 1)
-                 & -(1 << GCTYPEBITS)];
+  unsigned char c[(sizeof (union Lisp_Misc) + GCALIGNMENT - 1)
+                 & -GCALIGNMENT];
 #endif
 };
 
@@ -4563,9 +4562,9 @@
   struct mem_node *m;
 
   /* Quickly rule out some values which can't point to Lisp data.
-     USE_LSB_TAG needs Lisp data to be aligned on multiples of 1 << GCTYPEBITS.
+     USE_LSB_TAG needs Lisp data to be aligned on multiples of GCALIGNMENT.
      Otherwise, assume that Lisp data is aligned on even addresses.  */
-  if ((intptr_t) p % (USE_LSB_TAG ? 1 << GCTYPEBITS : 2))
+  if ((intptr_t) p % (USE_LSB_TAG ? GCALIGNMENT : 2))
     return;
 
   m = mem_find (p);
@@ -5080,7 +5079,7 @@
 {
   void *result;
 #if USE_LSB_TAG
-  size_t alignment = (1 << GCTYPEBITS);
+  size_t alignment = GCALIGNMENT;
 #else
   size_t alignment = alignof (EMACS_INT);
 


reply via email to

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