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 committed Mar 6, 2024
1 parent ebcaf4a commit 7a9f9f5
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 7a9f9f5

Please sign in to comment.