mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-23 04:50:28 +02:00
* __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.)
This commit is contained in:
parent
dcab04e112
commit
35eec7384c
2 changed files with 6 additions and 5 deletions
|
@ -285,11 +285,12 @@ extern unsigned int scm_async_clock;
|
||||||
|
|
||||||
However, GCC's volatile asm feature forms a barrier over which code is
|
However, GCC's volatile asm feature forms a barrier over which code is
|
||||||
never moved. So if you add...
|
never moved. So if you add...
|
||||||
asm volatile ("");
|
asm ("");
|
||||||
...to each of the DEFER_INTS and ALLOW_INTS macros, the critical code
|
...to each of the DEFER_INTS and ALLOW_INTS macros, the critical
|
||||||
will always remain in place. */
|
code will always remain in place. asm's without inputs or outputs
|
||||||
|
are implicitly volatile. */
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#define SCM_FENCE asm volatile ("")
|
#define SCM_FENCE asm /* volatile */ ("")
|
||||||
#else
|
#else
|
||||||
#define SCM_FENCE
|
#define SCM_FENCE
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1113,7 +1113,7 @@ scm_gc_sweep ()
|
||||||
if ((SCM_CDR (vcell) == 0) || (SCM_CDR (vcell) == 1))
|
if ((SCM_CDR (vcell) == 0) || (SCM_CDR (vcell) == 1))
|
||||||
{
|
{
|
||||||
SCM *p = (SCM *) SCM_GCCDR (scmptr);
|
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... */
|
/* I feel like I'm programming in BCPL here... */
|
||||||
free ((char *) p[scm_struct_i_ptr]);
|
free ((char *) p[scm_struct_i_ptr]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue