diff --git a/src/boehm_gc.c b/src/boehm_gc.c index b74ab25390..227da46dcf 100644 --- a/src/boehm_gc.c +++ b/src/boehm_gc.c @@ -56,20 +56,6 @@ void MakeBagTypePublic(int type) DSInfoBags[type] = DSI_PUBLIC; } -Bag MakeBagPublic(Bag bag) -{ - MEMBAR_WRITE(); - SET_REGION(bag, 0); - return bag; -} - -Bag MakeBagReadOnly(Bag bag) -{ - MEMBAR_WRITE(); - SET_REGION(bag, ReadOnlyRegion); - return bag; -} - #endif // HPCGAP @@ -332,14 +318,6 @@ UInt CollectBags(UInt size, UInt full) return 1; } -#ifdef HPCGAP -void RetypeBagIfWritable(Obj obj, UInt new_type) -{ - if (CheckWriteAccess(obj)) - RetypeBag(obj, new_type); -} -#endif - void RetypeBag(Bag bag, UInt new_type) { BagHeader * header = BAG_HEADER(bag); diff --git a/src/hpc/region.c b/src/hpc/region.c index 5f24775a86..2838571991 100644 --- a/src/hpc/region.c +++ b/src/hpc/region.c @@ -18,7 +18,7 @@ // #include "hpc/misc.h" #include "hpc/thread.h" -// #include "hpc/guards.h" +#include "hpc/guards.h" #include @@ -59,3 +59,23 @@ Region * RegionBag(Bag bag) MEMBAR_READ(); return result; } + +Bag MakeBagPublic(Bag bag) +{ + MEMBAR_WRITE(); + SET_REGION(bag, 0); + return bag; +} + +Bag MakeBagReadOnly(Bag bag) +{ + MEMBAR_WRITE(); + SET_REGION(bag, ReadOnlyRegion); + return bag; +} + +void RetypeBagIfWritable(Obj obj, UInt new_type) +{ + if (CheckWriteAccess(obj)) + RetypeBag(obj, new_type); +}