diff options
author | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2003-09-18 20:55:40 +0000 |
---|---|---|
committer | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2003-09-18 20:55:40 +0000 |
commit | 534c55a97d9860059a2d2042263cce3cad364b2c (patch) | |
tree | d50165f4aa115e6fac127fcd8fdfd51eac834ffc /libguile/gc-card.c | |
parent | 29c4382afda07debaef4f5d2534f5272bca15fdd (diff) | |
download | guile-534c55a97d9860059a2d2042263cce3cad364b2c.tar.gz |
This set of patches introduces a new tc7 code scm_tc7_number for
numbers. Bignums, reals and complex numbers are turned from smobs
into subtypes of scm_tc7_number.
* tags.h (scm_tc7_number): New.
* eq.c (scm_equal_p), eval.c (SCM_CEVAL), evalext.c
(scm_self_evaluating_p), gc-card.c (scm_i_sweep_card), gc-mark.c
(scm_gc_mark_dependencies), goops.c (create_smob_classes), hash.c
(scm_hasher), numbers.c, numbers.h (SCM_NUMP), objects.c
(scm_class_of), print.c (scm_iprin1), smob.c
(scm_smob_prehistory): Don't handle bignums, reals and complex
numbers as subtypes of scm_tc7_smob any more.
* numbers.h, tags.h (scm_tc16_big, scm_tc16_real,
scm_tc16_complex): Moved definitions from tags.h to numbers.h.
Diffstat (limited to 'libguile/gc-card.c')
-rw-r--r-- | libguile/gc-card.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/libguile/gc-card.c b/libguile/gc-card.c index 26fd425d5..432ead5a9 100644 --- a/libguile/gc-card.c +++ b/libguile/gc-card.c @@ -173,6 +173,21 @@ scm_i_sweep_card (scm_t_cell * p, SCM *free_list, scm_t_heap_segment*seg) "vector"); break; #endif + case scm_tc7_number: + switch SCM_TYP16 (scmptr) + { + case scm_tc16_real: + break; + case scm_tc16_big: + mpz_clear (SCM_I_BIG_MPZ (scmptr)); + /* nothing else to do here since the mpz is in a double cell */ + break; + case scm_tc16_complex: + scm_gc_free (SCM_COMPLEX_MEM (scmptr), sizeof (scm_t_complex), + "complex"); + break; + } + break; case scm_tc7_string: scm_gc_free (SCM_STRING_CHARS (scmptr), SCM_STRING_LENGTH (scmptr) + 1, "string"); @@ -232,15 +247,6 @@ scm_i_sweep_card (scm_t_cell * p, SCM *free_list, scm_t_heap_segment*seg) switch SCM_TYP16 (scmptr) { case scm_tc_free_cell: - case scm_tc16_real: - break; - case scm_tc16_big: - mpz_clear (SCM_I_BIG_MPZ (scmptr)); - /* nothing else to do here since the mpz is in a double cell */ - break; - case scm_tc16_complex: - scm_gc_free (SCM_COMPLEX_MEM (scmptr), sizeof (scm_t_complex), - "complex"); break; default: { |