Skip to content

Commit

Permalink
Use MarkAllButFirstSubBags for T_BIPART
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fingolfin authored and james-d-mitchell committed Mar 9, 2024
1 parent 27a20e1 commit dc6462b
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/pkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,6 @@ void TBlocksObjLoadFunc(Obj o) {
ADDR_OBJ(o)[0] = reinterpret_cast<Obj>(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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit dc6462b

Please sign in to comment.