Index: src/storage-compact.h =================================================================== --- src/storage-compact.h (revision 5037) +++ src/storage-compact.h (working copy) @@ -639,11 +639,14 @@ (SCM_ASSERT(SCM_ALIGNED_SYMBOL_NAME(n)), \ SCM_SET_Y(SCM_SYMBOL_PTR(o), (scm_uintobj_t)(n) | SCM_MTAG_SYMBOL)) #define SCM_ISAL_SYMBOL_INIT(o, n, c) \ - (SCM_ASSERT(SCM_ALIGNED_SYMBOL_NAME(n)), \ - SCM_INIT((o), \ - (c), \ - (scm_uintobj_t)(n) | SCM_MTAG_SYMBOL, \ - SCM_PTAG_MISC)) + do { \ + char *_s = scm_align_str(n); \ + (SCM_ASSERT(SCM_ALIGNED_SYMBOL_NAME(_s)), \ + SCM_INIT((o), \ + (c), \ + (scm_uintobj_t)(_s) | SCM_MTAG_SYMBOL, \ + SCM_PTAG_MISC)); \ + } while (0) #define SCM_CELL_SYMBOLP(c) SCM_MISC_CELL_TYPEP((c), SYMBOL) #define SCM_CELL_SYMBOL_FIN(c) \ do { \ Index: src/sigscheme.h =================================================================== --- src/sigscheme.h (revision 5037) +++ src/sigscheme.h (working copy) @@ -1242,6 +1242,7 @@ SCM_EXPORT void *scm_calloc(size_t number, size_t size); SCM_EXPORT void *scm_realloc(void *ptr, size_t size); SCM_EXPORT char *scm_strdup(const char *str); +SCM_EXPORT char *scm_align_str(char *str); /* storage-gc.c */ SCM_EXPORT void scm_gc_protect(ScmObj *var); Index: src/alloc.c =================================================================== --- src/alloc.c (revision 5037) +++ src/alloc.c (working copy) @@ -181,7 +181,6 @@ return copied; } -#if 0 /* For 'name' slot of symbol object on storage-compact. If your malloc(3) does * not ensure 8-bytes alignment, Complete this function and hook this into * symbol object creation and modification. -- YamaKen 2006-05-30 */ @@ -192,17 +191,16 @@ size_t size; /* Use ScmCell-alignment to ensure at least 8-bytes aligned. */ - if ((uintptr_t)ptr % sizeof(ScmCell)) { + if ((uintptr_t)str % sizeof(ScmCell)) { size = strlen(str) + sizeof(""); - copied = scm_malloc_aligned8(size); + copied = scm_malloc_aligned(size); strcpy(copied, str); free(str); return copied; } else { - return ptr; + return str; } } -#endif /*======================================= Extendable Local Buffer