From 1b1a63d3231d7928ec843d8bdca24cee9bdc6289 Mon Sep 17 00:00:00 2001 From: Helmut Eller Date: Thu, 13 Jun 2024 10:24:53 +0200 Subject: [PATCH 4/5] Fix code genarator * admin/igc-codegen.el (igccg--obj-types) (igccg--layouts): Add IGC_OBJ_HASH_VEC. * src/igc.c (dflt_scanx_obj): Fix nbytes. --- admin/igc-codegen.el | 10 +++++++++- src/igc.c | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/admin/igc-codegen.el b/admin/igc-codegen.el index f9a6c02827a..e83279dd9c2 100644 --- a/admin/igc-codegen.el +++ b/admin/igc-codegen.el @@ -24,6 +24,7 @@ igccg--obj-types IGC_OBJ_BLV IGC_OBJ_PTR_VEC IGC_OBJ_OBJ_VEC + IGC_OBJ_HASH_VEC IGC_OBJ_HANDLER IGC_OBJ_BYTES IGC_OBJ_BUILTIN_SYMBOL @@ -420,7 +421,10 @@ igccg--layouts '((tagged (path u s name)) (tagged (path u s function)) (tagged (path u s plist)) - (untagged (path u s next)) + (cfg (not IN_MY_FORK) + (untagged (path u s next))) + (cfg IN_MY_FORK + (tagged (path u s package))) (switch (path u s redirect) (SYMBOL_PLAINVAL (tagged (path u s val value))) @@ -517,6 +521,10 @@ igccg--layouts 'obj_vec 'IGC_OBJ_OBJ_VEC nil nil nil 'Lisp_Object '((array tagged "%s" (igc-header-len)))) + (igccg--make-layout + 'hash_vec 'IGC_OBJ_HASH_VEC nil nil nil 'Lisp_Object + '((array tagged "%s" (igc-header-len)))) + (igccg--make-layout 'handler 'IGC_OBJ_HANDLER nil nil nil '(struct handler) '((tagged tag_or_ch) diff --git a/src/igc.c b/src/igc.c index 7f213909677..41d99419dbd 100644 --- a/src/igc.c +++ b/src/igc.c @@ -1655,14 +1655,14 @@ dflt_scanx_obj (mps_ss_t ss, mps_addr_t base_start, mps_addr_t base_limit, struct igc_stats *st = closure; mps_word_t obj_type = header->obj_type; igc_assert (obj_type < IGC_OBJ_NUM_TYPES); - st->obj[obj_type].nwords += header->nwords; + st->obj[obj_type].nbytes += header_nbytes (header); st->obj[obj_type].nobjs += 1; if (obj_type == IGC_OBJ_VECTOR) { struct Lisp_Vector *v = (struct Lisp_Vector *)client; enum pvec_type pvec_type = pseudo_vector_type (v->header); igc_assert (0 <= pvec_type && pvec_type <= PVEC_TAG_MAX); - st->pvec[pvec_type].nwords += header->nwords; + st->pvec[pvec_type].nbytes += header_nbytes (header); st->pvec[pvec_type].nobjs += 1; } } -- 2.39.2