+2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
+
+ 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 <eliz@gnu.org>
* w32menu.c (set_frame_menubar, initialize_frame_menubar): Don't
#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
/* 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. */
{
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
};
{
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
};
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);
{
void *result;
#if USE_LSB_TAG
- size_t alignment = (1 << GCTYPEBITS);
+ size_t alignment = GCALIGNMENT;
#else
size_t alignment = alignof (EMACS_INT);