From 7a9f9f519da88bb84b4408637e02c799f9f6c508 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 6 Mar 2024 14:43:24 +0100 Subject: [PATCH] Use MarkAllButFirstSubBags for T_BIPART T_BIPART consists of a general pointer not managed by GAP's GC, plus two bag references (which may be NULL). Hence we can use MarkAllButFirstSubBags instead of a custom marking function. --- src/pkg.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/pkg.cpp b/src/pkg.cpp index 8af3361b0..8b0c8fc3f 100644 --- a/src/pkg.cpp +++ b/src/pkg.cpp @@ -332,15 +332,6 @@ void TBlocksObjLoadFunc(Obj o) { ADDR_OBJ(o)[0] = reinterpret_cast(blocks); } -void TBipartObjMarkSubBags(Obj o) { - if (ADDR_OBJ(o)[1] != NULL) { - MarkBag(ADDR_OBJ(o)[1]); - } - if (ADDR_OBJ(o)[2] != NULL) { - MarkBag(ADDR_OBJ(o)[2]); - } -} - // Filters for IS_BIPART, IS_BLOCKS Obj IsBipartFilt; @@ -512,7 +503,7 @@ static Int InitKernel(StructInitInfo* module) { SaveObjFuncs[T_BIPART] = TBipartObjSaveFunc; LoadObjFuncs[T_BIPART] = TBipartObjLoadFunc; - InitMarkFuncBags(T_BIPART, &TBipartObjMarkSubBags); + InitMarkFuncBags(T_BIPART, &MarkAllButFirstSubBags); InitFreeFuncBag(T_BIPART, &TBipartObjFreeFunc); ProdFuncs[T_BIPART][T_BIPART] = BIPART_PROD;