From 35eec7384c8559346c469e471a79fda9369f86a5 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Fri, 12 Feb 1999 10:13:20 +0000 Subject: [PATCH] * __scm.h (SCM_FENCE): Fix `asm volatile' warnings for EGCS. * gc.c (scm_gc_sweep): Properly properly record the size of a freed structure. (Thanks to Greg Harvey.) --- libguile/__scm.h | 9 +++++---- libguile/gc.c | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libguile/__scm.h b/libguile/__scm.h index 170410577..0f6d24d6c 100644 --- a/libguile/__scm.h +++ b/libguile/__scm.h @@ -285,11 +285,12 @@ extern unsigned int scm_async_clock; However, GCC's volatile asm feature forms a barrier over which code is never moved. So if you add... - asm volatile (""); - ...to each of the DEFER_INTS and ALLOW_INTS macros, the critical code - will always remain in place. */ + asm (""); + ...to each of the DEFER_INTS and ALLOW_INTS macros, the critical + code will always remain in place. asm's without inputs or outputs + are implicitly volatile. */ #ifdef __GNUC__ -#define SCM_FENCE asm volatile ("") +#define SCM_FENCE asm /* volatile */ ("") #else #define SCM_FENCE #endif diff --git a/libguile/gc.c b/libguile/gc.c index 6e77235f7..b6b1fb56a 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -1113,7 +1113,7 @@ scm_gc_sweep () if ((SCM_CDR (vcell) == 0) || (SCM_CDR (vcell) == 1)) { SCM *p = (SCM *) SCM_GCCDR (scmptr); - m += (p[scm_struct_i_n_words] + 7) * sizeof (SCM); + m += p[scm_struct_i_n_words] * sizeof (SCM) + 7; /* I feel like I'm programming in BCPL here... */ free ((char *) p[scm_struct_i_ptr]); }