1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-13 15:10:34 +02:00

use scm_malloc_pointerless to alloc aligned blocks in fallback

* libguile/continuations.c (SCM_DECLARE_STATIC_ALIGNED_ARRAY)
  (SCM_STATIC_ALIGNED_ARRAY)
* libguile/control.c (SCM_DECLARE_STATIC_ALIGNED_ARRAY)
  (SCM_STATIC_ALIGNED_ARRAY): Tweak backslashes. Use
  scm_malloc_pointerless to ensure alignment.
This commit is contained in:
Andy Wingo 2010-07-17 12:22:17 +02:00
parent 6f8d7b12bb
commit 1c05a2a16d
2 changed files with 8 additions and 10 deletions

View file

@ -82,8 +82,7 @@ static SCM_ALIGNED (alignment) const type sym[]
#define SCM_DECLARE_STATIC_ALIGNED_ARRAY(type, sym) \
static type *sym
#define SCM_STATIC_ALIGNED_ARRAY(alignment, type, sym) \
SCM_SNARF_INIT(sym = scm_malloc (sizeof(sym##__unaligned) + alignment - 1); \
sym = ALIGN_PTR (type, sym, alignment); \
SCM_SNARF_INIT(sym = scm_malloc_pointerless (sizeof(sym##__unaligned)); \
memcpy (sym, sym##__unaligned, sizeof(sym##__unaligned));) \
static type *sym = NULL; \
static const type sym##__unaligned[]

View file

@ -90,8 +90,7 @@ static SCM_ALIGNED (alignment) const type sym[]
#define SCM_DECLARE_STATIC_ALIGNED_ARRAY(type, sym) \
static type *sym
#define SCM_STATIC_ALIGNED_ARRAY(alignment, type, sym) \
SCM_SNARF_INIT(sym = scm_malloc (sizeof(sym##__unaligned) + alignment - 1); \
sym = ALIGN_PTR (type, sym, alignment); \
SCM_SNARF_INIT(sym = scm_malloc_pointerless (sizeof(sym##__unaligned); \
memcpy (sym, sym##__unaligned, sizeof(sym##__unaligned));) \
static type *sym = NULL; \
static const type sym##__unaligned[]