Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gap-system/gap into ah/immediate
Browse files Browse the repository at this point in the history
  • Loading branch information
hulpke committed Apr 28, 2018
2 parents 4ef8805 + d0693f8 commit 0c54f7a
Show file tree
Hide file tree
Showing 25 changed files with 574 additions and 463 deletions.
255 changes: 104 additions & 151 deletions hpcgap/src/c_type1.c

Large diffs are not rendered by default.

26 changes: 2 additions & 24 deletions lib/type.g
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,6 @@
##


#############################################################################
##
#V POS_DATA_TYPE . . . . . . . . position where the data of a type is stored
#V POS_NUMB_TYPE . . . . . . . position where the number of a type is stored
#V POS_FIRST_FREE_TYPE . . . . . first position that has no overall meaning
##
## <ManSection>
## <Var Name="POS_DATA_TYPE"/>
## <Var Name="POS_NUMB_TYPE"/>
## <Var Name="POS_FIRST_FREE_TYPE"/>
##
## <Description>
## Note that the family and the flags list are stored at positions 1 and 2,
## respectively.
## </Description>
## </ManSection>
##
BIND_CONSTANT( "POS_DATA_TYPE", 3 );
BIND_CONSTANT( "POS_NUMB_TYPE", 4 );
BIND_CONSTANT( "POS_FIRST_FREE_TYPE", 5 );


#############################################################################
##
#F NEW_TYPE_NEXT_ID . . . . . . . . . . . . GAP integer numbering the types
Expand Down Expand Up @@ -600,8 +578,8 @@ InstallOtherMethod( PRINT_OBJ,
function ( type )
local family, flags, data;

family := type![1];
flags := type![2];
family := type![ POS_FAMILY_TYPE ];
flags := type![ POS_FLAGS_TYPE ];
data := type![ POS_DATA_TYPE ];
Print( "NewType( ", family );
if flags <> [] or data <> false then
Expand Down
10 changes: 5 additions & 5 deletions lib/type.gi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
## Return list of filters set in the given type.
##
InstallMethod(FiltersType, "for a type", [ IsType ],
type -> FILTERS{ TRUES_FLAGS(type![2]) });
type -> FILTERS{ TRUES_FLAGS(type![POS_FLAGS_TYPE]) });

#############################################################################
##
Expand Down Expand Up @@ -101,11 +101,11 @@ function ( type )
local res, family, flags, data, fnams;

res := "<Type: (";
family := type![1];
family := type![POS_FAMILY_TYPE];
Append(res, family!.NAME);
Append(res, ", ");

flags := type![2];
flags := type![POS_FLAGS_TYPE];
Append(res, NamesFilterShort(flags, 3) );
Append(res, ")");

Expand All @@ -130,8 +130,8 @@ function ( type )
local res, family, flags, data, fnams;

res := "";
family := type![1];
flags := type![2];
family := type![POS_FAMILY_TYPE];
flags := type![POS_FLAGS_TYPE];
data := type![POS_DATA_TYPE];

Append(res, STRINGIFY("family:\n ", family!.NAME));
Expand Down
34 changes: 17 additions & 17 deletions lib/type1.g
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ BIND_GLOBAL( "NEW_TYPE", function ( typeOfTypes, family, flags, data, parent )
hash := HASH_FLAGS(flags) mod family!.HASH_SIZE + 1;
if IsBound( cache[hash] ) then
cached := cache[hash];
if IS_EQUAL_FLAGS( flags, cached![2] ) then
flags := cached![2];
if IS_EQUAL_FLAGS( flags, cached![POS_FLAGS_TYPE] ) then
flags := cached![POS_FLAGS_TYPE];
if IS_IDENTICAL_OBJ( data, cached![ POS_DATA_TYPE ] )
and IS_IDENTICAL_OBJ( typeOfTypes, TYPE_OBJ(cached) )
then
Expand Down Expand Up @@ -334,7 +334,7 @@ BIND_GLOBAL( "NEW_TYPE", function ( typeOfTypes, family, flags, data, parent )
fi;
ncl := 3*family!.HASH_SIZE+1;
for t in cache do
ncache[ HASH_FLAGS(t![2]) mod ncl + 1] := t;
ncache[ HASH_FLAGS(t![POS_FLAGS_TYPE]) mod ncl + 1] := t;
od;
family!.HASH_SIZE := ncl;
family!.TYPES := ncache;
Expand Down Expand Up @@ -413,19 +413,19 @@ end );
##
BIND_GLOBAL( "Subtype2", function ( type, filter )
return NEW_TYPE( TypeOfTypes,
type![1],
type![POS_FAMILY_TYPE],
WITH_IMPS_FLAGS( AND_FLAGS(
type![2],
type![POS_FLAGS_TYPE],
FLAGS_FILTER( filter ) ) ),
type![ POS_DATA_TYPE ], type );
end );


BIND_GLOBAL( "Subtype3", function ( type, filter, data )
return NEW_TYPE( TypeOfTypes,
type![1],
type![POS_FAMILY_TYPE],
WITH_IMPS_FLAGS( AND_FLAGS(
type![2],
type![POS_FLAGS_TYPE],
FLAGS_FILTER( filter ) ) ),
data, type );
end );
Expand Down Expand Up @@ -470,19 +470,19 @@ end );
##
BIND_GLOBAL( "SupType2", function ( type, filter )
return NEW_TYPE( TypeOfTypes,
type![1],
type![POS_FAMILY_TYPE],
SUB_FLAGS(
type![2],
type![POS_FLAGS_TYPE],
FLAGS_FILTER( filter ) ),
type![ POS_DATA_TYPE ], type );
end );


BIND_GLOBAL( "SupType3", function ( type, filter, data )
return NEW_TYPE( TypeOfTypes,
type![1],
type![POS_FAMILY_TYPE],
SUB_FLAGS(
type![2],
type![POS_FLAGS_TYPE],
FLAGS_FILTER( filter ) ),
data, type );
end );
Expand Down Expand Up @@ -516,7 +516,7 @@ end );
## </Description>
## </ManSection>
##
BIND_GLOBAL( "FamilyType", K -> K![1] );
BIND_GLOBAL( "FamilyType", K -> K![POS_FAMILY_TYPE] );


#############################################################################
Expand All @@ -530,7 +530,7 @@ BIND_GLOBAL( "FamilyType", K -> K![1] );
## </Description>
## </ManSection>
##
BIND_GLOBAL( "FlagsType", K -> K![2] );
BIND_GLOBAL( "FlagsType", K -> K![POS_FLAGS_TYPE] );


#############################################################################
Expand Down Expand Up @@ -715,7 +715,7 @@ BIND_GLOBAL( "Objectify", function ( type, obj )
SET_TYPE_COMOBJ( obj, type );
fi;
if not IsNoImmediateMethodsObject(obj) then
RunImmediateMethods( obj, type![2] );
RunImmediateMethods( obj, type![POS_FLAGS_TYPE] );
fi;
if IsHPCGAP then
if IsReadOnlyPositionalObjectRep(obj) then
Expand Down Expand Up @@ -754,23 +754,23 @@ local type, newtype;
SET_TYPE_POSOBJ( obj, newtype );
if not ( IGNORE_IMMEDIATE_METHODS
or IsNoImmediateMethodsObject(obj) ) then
RunImmediateMethods( obj, SUB_FLAGS( newtype![2], type![2] ) );
RunImmediateMethods( obj, SUB_FLAGS( newtype![POS_FLAGS_TYPE], type![POS_FLAGS_TYPE] ) );
fi;
elif IS_COMOBJ( obj ) then
type:= TYPE_OBJ( obj );
newtype:= Subtype2( type, filter );
SET_TYPE_COMOBJ( obj, newtype );
if not ( IGNORE_IMMEDIATE_METHODS
or IsNoImmediateMethodsObject(obj) ) then
RunImmediateMethods( obj, SUB_FLAGS( newtype![2], type![2] ) );
RunImmediateMethods( obj, SUB_FLAGS( newtype![POS_FLAGS_TYPE], type![POS_FLAGS_TYPE] ) );
fi;
elif IS_DATOBJ( obj ) then
type:= TYPE_OBJ( obj );
newtype:= Subtype2( type, filter );
SET_TYPE_DATOBJ( obj, newtype );
if not ( IGNORE_IMMEDIATE_METHODS
or IsNoImmediateMethodsObject(obj) ) then
RunImmediateMethods( obj, SUB_FLAGS( newtype![2], type![2] ) );
RunImmediateMethods( obj, SUB_FLAGS( newtype![POS_FLAGS_TYPE], type![POS_FLAGS_TYPE] ) );
fi;
elif IS_PLIST_REP( obj ) then
SET_FILTER_LIST( obj, filter );
Expand Down
4 changes: 4 additions & 0 deletions src/boehm_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,10 @@ void MarkAllSubBags(Bag bag)
{
}

void MarkAllButFirstSubBags(Bag bag)
{
}

void MarkArrayOfBags(const Bag array[], UInt count)
{
}
Loading

0 comments on commit 0c54f7a

Please sign in to comment.