diff options
author | Ludovic Courtès <ludo@gnu.org> | 2009-11-02 00:55:17 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2009-11-02 00:55:17 +0100 |
commit | ed7e0765c48bbf6d028d9eefd15a3dedb53c92ec (patch) | |
tree | 111aaa890392f97b1ff8887b8aeb99a6fb8341e8 /libguile/weaks.h | |
parent | 88cbb421895656c6d255610e32c2ae1addb2ea07 (diff) | |
download | guile-ed7e0765c48bbf6d028d9eefd15a3dedb53c92ec.tar.gz |
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.
Diffstat (limited to 'libguile/weaks.h')
-rw-r--r-- | libguile/weaks.h | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/libguile/weaks.h b/libguile/weaks.h index eecc6184e..5cb8bc388 100644 --- a/libguile/weaks.h +++ b/libguile/weaks.h @@ -33,17 +33,6 @@ #define SCM_WVECT_WEAK_KEY_P(x) (SCM_I_WVECT_EXTRA(x) & SCM_WVECTF_WEAK_KEY) #define SCM_WVECT_WEAK_VALUE_P(x) (SCM_I_WVECT_EXTRA(x) & SCM_WVECTF_WEAK_VALUE) -/* The DELTA field is used by the abstract hash tables. During GC, - this field will be set to the number of items that have been - dropped. The abstract hash table will then use it to update its - item count. DELTA is unsigned. -*/ - -#define SCM_I_WVECT_DELTA(x) (SCM_I_WVECT_EXTRA(x) >> 3) -#define SCM_I_SET_WVECT_DELTA(x,n) (SCM_I_SET_WVECT_EXTRA \ - ((x), ((SCM_I_WVECT_EXTRA (x) & 7) \ - | ((n) << 3)))) - #define SCM_I_WVECT_TYPE(x) (SCM_I_WVECT_EXTRA(x) & 7) #define SCM_I_SET_WVECT_TYPE(x,t) (SCM_I_SET_WVECT_EXTRA \ ((x), (SCM_I_WVECT_EXTRA (x) & ~7) | (t))) |