1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-07 08:40:21 +02:00

* Further references to SCM_CHARS removed.

This commit is contained in:
Dirk Herrmann 2000-09-26 20:34:26 +00:00
parent 74cc85038e
commit 06ee04b27d
2 changed files with 40 additions and 28 deletions

View file

@ -1,3 +1,15 @@
2000-09-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
* gc.c (scm_igc): : Eliminate references to SCM_LENGTH and
SCM_CHARS from comment.
(scm_gc_mark, scm_gc_sweep): Replace SCM_CHARS with
SCM_SYMBOL_CHARS or SCM_CCLO_BASE or SCM_UVECTOR_BASE or
SCM_BDIGITS, and replace SCM_VELTS with SCM_VECTOR_BASE or
SCM_CONTREGS, according to the corresponding types.
(scm_gc_sweep): Simplify sweeping of uniform vectors.
2000-09-26 Dirk Herrmann <D.Herrmann@tu-bs.de> 2000-09-26 Dirk Herrmann <D.Herrmann@tu-bs.de>
* procs.h (SCM_CCLO_LENGTH, SCM_SET_CCLO_LENGTH, SCM_CCLO_BASE, * procs.h (SCM_CCLO_LENGTH, SCM_SET_CCLO_LENGTH, SCM_CCLO_BASE,

View file

@ -1028,8 +1028,8 @@ scm_igc (const char *what)
/* Protect from the C stack. This must be the first marking /* Protect from the C stack. This must be the first marking
* done because it provides information about what objects * done because it provides information about what objects
* are "in-use" by the C code. "in-use" objects are those * are "in-use" by the C code. "in-use" objects are those
* for which the values from SCM_LENGTH and SCM_CHARS must remain * for which the information about length and base address must
* usable. This requirement is stricter than a liveness * remain usable. This requirement is stricter than a liveness
* requirement -- in particular, it constrains the implementation * requirement -- in particular, it constrains the implementation
* of scm_vector_set_length_x. * of scm_vector_set_length_x.
*/ */
@ -1173,7 +1173,7 @@ gc_mark_nimp:
/* ptr is a struct */ /* ptr is a struct */
SCM layout = SCM_PACK (vtable_data [scm_vtable_index_layout]); SCM layout = SCM_PACK (vtable_data [scm_vtable_index_layout]);
int len = SCM_LENGTH (layout); int len = SCM_LENGTH (layout);
char * fields_desc = SCM_CHARS (layout); char * fields_desc = SCM_SYMBOL_CHARS (layout);
scm_bits_t * struct_data = (scm_bits_t *) SCM_STRUCT_DATA (ptr); scm_bits_t * struct_data = (scm_bits_t *) SCM_STRUCT_DATA (ptr);
if (vtable_data[scm_struct_i_flags] & SCM_STRUCTF_ENTITY) if (vtable_data[scm_struct_i_flags] & SCM_STRUCTF_ENTITY)
@ -1604,45 +1604,36 @@ scm_gc_sweep ()
break; break;
case scm_tc7_wvect: case scm_tc7_wvect:
m += (2 + SCM_LENGTH (scmptr)) * sizeof (SCM); m += (2 + SCM_LENGTH (scmptr)) * sizeof (SCM);
scm_must_free ((char *)(SCM_VELTS (scmptr) - 2)); scm_must_free (SCM_VECTOR_BASE (scmptr) - 2);
break; break;
case scm_tc7_vector: case scm_tc7_vector:
m += (SCM_LENGTH (scmptr) * sizeof (SCM));
scm_must_free (SCM_VECTOR_BASE (scmptr));
break;
#ifdef CCLO #ifdef CCLO
case scm_tc7_cclo: case scm_tc7_cclo:
#endif
m += (SCM_LENGTH (scmptr) * sizeof (SCM)); m += (SCM_LENGTH (scmptr) * sizeof (SCM));
freechars: scm_must_free (SCM_CCLO_BASE (scmptr));
scm_must_free (SCM_CHARS (scmptr));
/* SCM_SETCHARS(scmptr, 0);*/
break; break;
#endif
#ifdef HAVE_ARRAYS #ifdef HAVE_ARRAYS
case scm_tc7_bvect: case scm_tc7_bvect:
m += sizeof (long) * ((SCM_HUGE_LENGTH (scmptr) + SCM_LONG_BIT - 1) / SCM_LONG_BIT); m += sizeof (long) * ((SCM_HUGE_LENGTH (scmptr) + SCM_LONG_BIT - 1) / SCM_LONG_BIT);
goto freechars; scm_must_free (SCM_UVECTOR_BASE (scmptr));
break;
case scm_tc7_byvect: case scm_tc7_byvect:
m += SCM_HUGE_LENGTH (scmptr) * sizeof (char);
goto freechars;
case scm_tc7_ivect: case scm_tc7_ivect:
case scm_tc7_uvect: case scm_tc7_uvect:
m += SCM_HUGE_LENGTH (scmptr) * sizeof (long);
goto freechars;
case scm_tc7_svect: case scm_tc7_svect:
m += SCM_HUGE_LENGTH (scmptr) * sizeof (short);
goto freechars;
#ifdef HAVE_LONG_LONGS #ifdef HAVE_LONG_LONGS
case scm_tc7_llvect: case scm_tc7_llvect:
m += SCM_HUGE_LENGTH (scmptr) * sizeof (long_long);
goto freechars;
#endif #endif
case scm_tc7_fvect: case scm_tc7_fvect:
m += SCM_HUGE_LENGTH (scmptr) * sizeof (float);
goto freechars;
case scm_tc7_dvect: case scm_tc7_dvect:
m += SCM_HUGE_LENGTH (scmptr) * sizeof (double);
goto freechars;
case scm_tc7_cvect: case scm_tc7_cvect:
m += SCM_HUGE_LENGTH (scmptr) * 2 * sizeof (double); m += SCM_HUGE_LENGTH (scmptr) * scm_uniform_element_size (scmptr);
goto freechars; scm_must_free (SCM_UVECTOR_BASE (scmptr));
break;
#endif #endif
case scm_tc7_substring: case scm_tc7_substring:
break; break;
@ -1656,8 +1647,15 @@ scm_gc_sweep ()
break; break;
case scm_tc7_contin: case scm_tc7_contin:
m += SCM_LENGTH (scmptr) * sizeof (SCM_STACKITEM) + sizeof (scm_contregs); m += SCM_LENGTH (scmptr) * sizeof (SCM_STACKITEM) + sizeof (scm_contregs);
if (SCM_VELTS (scmptr)) if (SCM_CONTREGS (scmptr))
goto freechars; {
scm_must_free (SCM_CONTREGS (scmptr));
break;
}
else
{
continue;
}
case scm_tcs_subrs: case scm_tcs_subrs:
/* the various "subrs" (primitives) are never freed */ /* the various "subrs" (primitives) are never freed */
continue; continue;
@ -1689,11 +1687,13 @@ scm_gc_sweep ()
#ifdef SCM_BIGDIG #ifdef SCM_BIGDIG
case scm_tc16_big: case scm_tc16_big:
m += (SCM_NUMDIGS (scmptr) * SCM_BITSPERDIG / SCM_CHAR_BIT); m += (SCM_NUMDIGS (scmptr) * SCM_BITSPERDIG / SCM_CHAR_BIT);
goto freechars; scm_must_free (SCM_BDIGITS (scmptr));
break;
#endif /* def SCM_BIGDIG */ #endif /* def SCM_BIGDIG */
case scm_tc16_complex: case scm_tc16_complex:
m += 2 * sizeof (double); m += sizeof (scm_complex_t);
goto freechars; scm_must_free (SCM_CHARS (scmptr));
break;
default: default:
{ {
int k; int k;