-/* Weak vectors. */
-
-/* Allocate memory for the elements of a weak vector on behalf of the
- caller. */
-static SCM
-make_weak_vector (scm_t_bits type, size_t c_size)
-{
- SCM *vector;
- size_t total_size;
-
- total_size = (c_size + SCM_I_VECTOR_HEADER_SIZE) * sizeof (SCM);
- vector = (SCM *) scm_gc_malloc_pointerless (total_size, "weak vector");
-
- ((scm_t_bits *) vector)[0] = (c_size << 8) | scm_tc7_wvect;
- ((scm_t_bits *) vector)[1] = type;
-
- return PTR2SCM (vector);
-}
-
-/* Return a new weak vector. The allocated vector will be of the given weak
- vector subtype. It will contain SIZE elements which are initialized with
- the FILL object, or, if FILL is undefined, with an unspecified object. */
-SCM
-scm_i_make_weak_vector (scm_t_bits type, SCM size, SCM fill)
-{
- SCM wv, *base;
- size_t c_size, j;
-
- if (SCM_UNBNDP (fill))
- fill = SCM_UNSPECIFIED;
-
- c_size = scm_to_unsigned_integer (size, 0, VECTOR_MAX_LENGTH);
- wv = make_weak_vector (type, c_size);
- base = SCM_I_WVECT_GC_WVELTS (wv);
-
- for (j = 0; j != c_size; ++j)
- base[j] = fill;
-
- return wv;
-}
-
-/* Return a new weak vector with type TYPE and whose content are taken from
- list LST. */
-SCM
-scm_i_make_weak_vector_from_list (scm_t_bits type, SCM lst)
-{
- SCM wv, *elt;
- long c_size;
-
- c_size = scm_ilength (lst);
- SCM_ASSERT (c_size >= 0, lst, SCM_ARG2, "scm_i_make_weak_vector_from_list");
-
- wv = make_weak_vector(type, (size_t) c_size);
-
- for (elt = SCM_I_WVECT_GC_WVELTS (wv);
- scm_is_pair (lst);
- lst = SCM_CDR (lst), elt++)
- {
- *elt = SCM_CAR (lst);
- }
-
- return wv;
-}
-
-
-\f