Allocate vectors in a contiguous memory area.
authorLudovic Courtès <ludo@gnu.org>
Sun, 1 Nov 2009 23:55:17 +0000 (00:55 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sun, 1 Nov 2009 23:55:17 +0000 (00:55 +0100)
commited7e0765c48bbf6d028d9eefd15a3dedb53c92ec
tree111aaa890392f97b1ff8887b8aeb99a6fb8341e8
parent88cbb421895656c6d255610e32c2ae1addb2ea07
Allocate vectors in a contiguous memory area.

* libguile/vectors.c (scm_c_make_vector): Allocate the whole vector and
  header with `scm_gc_malloc ()'.
  (scm_vector_copy): Use `scm_c_make_vector ()'.
  (scm_i_vector_free, MAKE_WEAK_VECTOR): Remove.
  (allocate_weak_vector): Rename to...
  (make_weak_vector): ... this.  Change to return the whole weak vector,
  allocated with `scm_gc_malloc_pointerless ()'.
  (scm_i_make_weak_vector, scm_i_make_weak_vector_from_list): Use
  `make_weak_vector ()'.

* libguile/vectors.h (SCM_I_VECTOR_HEADER_SIZE): New macro.
  (SCM_I_VECTOR_ELTS): Write in terms of `SCM_I_VECTOR_WELTS ()'.
  (SCM_I_VECTOR_WELTS): Update to the new representation.
  (SCM_I_WVECT_EXTRA, SCM_I_SET_WVECT_EXTRA): Likewise.
  (SCM_I_WVECT_GC_CHAIN, SCM_I_SET_WVECT_GC_CHAIN): Remove.

* libguile/weaks.h (SCM_I_WVECT_DELTA, SCM_I_SET_WVECT_DELTA): Remove.
libguile/vectors.c
libguile/vectors.h
libguile/weaks.h