diff --git a/hpcgap/lib/system.g b/hpcgap/lib/system.g index af788aa427..88e2527d8f 100644 --- a/hpcgap/lib/system.g +++ b/hpcgap/lib/system.g @@ -76,7 +76,6 @@ BIND_GLOBAL( "GAPInfo", AtomicRecord(rec( help := [ "set hint for maximal workspace size (GAP may", "allocate more)"] ), rec( short:= "K", long := "limitworkspace", default := "0", arg := "", help := [ "set maximal workspace size (GAP never", "allocates more)"] ), - rec( short:= "c", default := "0", arg := "", help := [ "set the cache size value"] ), rec( short:= "s", default := "4g", arg := " (see "InitBags") was 0, 'CollectBags' makes all of the -** free storage available for allocations by setting 'StopBags' to 'EndBags' -** after garbage collections. In this case garbage collections are only -** performed when no free storage is left. If was nonzero, -** 'CollectBags' makes 'AllocSizeBags' bytes available by setting 'StopBags' -** to 'AllocBags + 2+WORDS_BAG() + WORDS_BAG(AllocSizeBags)' after -** garbage collections, where is the size of the bag 'NewBag' is -** currently allocating. 'AllocSizeBags' is usually , but is -** increased if only very few large bags have been allocated since the last -** garbage collection and decreased again if sufficiently many bags have -** been allocated since the last garbage collection. The idea is to keep -** the allocation area small enough so that it fits in the processor cache. -** ** Note that the borders between the areas are not static. In particular ** each allocation increases the size of the young bags area and reduces the ** size of the allocation area. On the other hand each garbage collection @@ -950,7 +937,6 @@ void FinishedRestoringBags( void ) SizeDeadBags = 0; NrHalfDeadBags = 0; ChangedBags = 0; - return; } @@ -1016,7 +1002,7 @@ void FinishBags( void ) *F InitBags(...) . . . . . . . . . . . . . . . . . . . . . initialize Gasman ** ** 'InitBags' remembers , , , -** , , , and in global +** , , and in global ** variables. It also allocates the initial workspace, and sets up the ** linked list of available masterpointer. */ @@ -1028,8 +1014,6 @@ Bag * StackBottomBags; UInt StackAlignBags; -UInt CacheSizeBags; - UInt DirtyBags; TNumAbortFuncBags AbortFuncBags; @@ -1040,7 +1024,6 @@ void InitBags ( TNumStackFuncBags stack_func, Bag * stack_bottom, UInt stack_align, - UInt cache_size, UInt dirty, TNumAbortFuncBags abort_func ) { @@ -1080,17 +1063,8 @@ void InitBags ( YoungBags = OldBags; AllocBags = OldBags; - /* remember the cache size */ - CacheSizeBags = cache_size; - if ( ! CacheSizeBags ) { - AllocSizeBags = 256; - StopBags = EndBags; - } - else { - AllocSizeBags = (CacheSizeBags+1023)/1024; - StopBags = AllocBags + WORDS_BAG(1024*AllocSizeBags) <= EndBags ? - AllocBags + WORDS_BAG(1024*AllocSizeBags) : EndBags; - } + AllocSizeBags = 256; + StopBags = EndBags; /* remember whether bags should be clean */ DirtyBags = dirty; @@ -2158,24 +2132,15 @@ UInt CollectBags ( if ( ! FullBags ) { /* maybe adjust the size of the allocation area */ - if ( ! CacheSizeBags ) { - if ( nrLiveBags+nrDeadBags +nrHalfDeadBags < 512 - - /* The test below should stop AllocSizeBags - growing uncontrollably when all bags are big */ - && StopBags > OldBags + 4*1024*WORDS_BAG(AllocSizeBags)) - AllocSizeBags += 256L; - else if ( 4096 < nrLiveBags+nrDeadBags+nrHalfDeadBags - && 256 < AllocSizeBags ) - AllocSizeBags -= 256; - } - else { - if ( nrLiveBags+nrDeadBags < 512 ) - AllocSizeBags += CacheSizeBags/1024; - else if ( 4096 < nrLiveBags+nrDeadBags+nrHalfDeadBags - && CacheSizeBags < AllocSizeBags ) - AllocSizeBags -= CacheSizeBags/1024; - } + if ( nrLiveBags+nrDeadBags +nrHalfDeadBags < 512 + + /* The test below should stop AllocSizeBags + growing uncontrollably when all bags are big */ + && StopBags > OldBags + 4*1024*WORDS_BAG(AllocSizeBags)) + AllocSizeBags += 256; + else if ( 4096 < nrLiveBags+nrDeadBags+nrHalfDeadBags + && 256 < AllocSizeBags ) + AllocSizeBags -= 256; /* if we dont get enough free storage or masterpointers do full gc */ if ( EndBags < StopBags + WORDS_BAG(1024*AllocSizeBags) @@ -2297,10 +2262,7 @@ UInt CollectBags ( SpaceBetweenPointers(EndBags, MptrBags)/(1024/sizeof(Bag))); /* reset the stop pointer */ - if ( ! CacheSizeBags || EndBags < StopBags+WORDS_BAG(1024*AllocSizeBags) ) - StopBags = EndBags; - else - StopBags = StopBags + WORDS_BAG(1024*AllocSizeBags); + StopBags = EndBags; /* if we are not done, then true again */ if ( ! done ) { diff --git a/src/gasman.h b/src/gasman.h index ea48d3b659..05487129a2 100644 --- a/src/gasman.h +++ b/src/gasman.h @@ -1067,7 +1067,7 @@ extern void CheckMasterPointers( void ); ** ** InitBags( , , ** , , , -** , , ) +** , ) ** ** 'InitBags' initializes {\Gasman}. It must be called from a application ** using {\Gasman} before any bags can be allocated. @@ -1128,20 +1128,6 @@ extern void CheckMasterPointers( void ); ** on the machine, the operating system, and the compiler. If the ** application provides another , is ignored. ** -** informs {\Gasman} whether the processor has a usable data -** cache and how large it is measured in bytes. If the application passes -** 0, {\Gasman} assumes that the processor has no data cache or a data cache -** to small to be useful. In this case the entire free storage is made -** available for allocations after garbage collections. If the application -** passes a nonzero value, {\Gasman} assumes that this is the size of the -** part of the data cache that should be used for the allocation area, and -** tries to keep the allocation area small enough so that it fits. For a -** processor that has separate data and instruction caches, the application -** should pass the size of the data cache minus 65536. For a processor with -** a unified cache, the application should pass the size of the unified -** cache minus 131072. The application probably should not pass a value -** less than 131072. -** ** The initialization flag determines whether bags allocated by ** 'NewBag' are initialized to contain only 0 or not. If is 0, the ** bags are initialized to contain only 0. If is 1, the bags @@ -1169,7 +1155,6 @@ extern void InitBags ( TNumStackFuncBags stack_func, Bag * stack_bottom, UInt stack_align, - UInt cache_size, UInt dirty, TNumAbortFuncBags abort_func ); diff --git a/src/hpc/boehm_gc.h b/src/hpc/boehm_gc.h index d91ba5bb03..0f20be4eed 100644 --- a/src/hpc/boehm_gc.h +++ b/src/hpc/boehm_gc.h @@ -304,7 +304,6 @@ void InitBags ( TNumStackFuncBags stack_func, Bag * stack_bottom, UInt stack_align, - UInt cache_size, UInt dirty, TNumAbortFuncBags abort_func ) { diff --git a/src/system.c b/src/system.c index af25a002bd..22f75289a7 100644 --- a/src/system.c +++ b/src/system.c @@ -116,22 +116,6 @@ const Char * SyArchitecture = SYS_ARCH; UInt SyCTRD; -/**************************************************************************** -** -*V SyCacheSize . . . . . . . . . . . . . . . . . . . . . . size of the cache -** -** 'SyCacheSize' is the size of the data cache. -** -** This is per default 0, which means that there is no usuable data cache. -** It is usually changed with the '-c' option in the script that starts GAP. -** -** This value is passed to 'InitBags'. -** -** Put in this package because the command line processing takes place here. -*/ -UInt SyCacheSize; - - /**************************************************************************** ** *V SyCheckCRCCompiledModule . . . check crc while loading compiled modules @@ -1804,8 +1788,6 @@ struct optInfo options[] = { { 'R', "", unsetString, &SyRestoring, 0}, /* kernel */ { 'U', "", storeString, SyCompileOptions, 1}, /* kernel */ { 'a', "", storeMemory, &preAllocAmount, 1 }, /* kernel -- is this still useful */ - { 'c', "", storeMemory, &SyCacheSize, 1 }, /* kernel, unless we provided a hook to set it from library, - never seems to be useful */ { 'e', "", toggle, &SyCTRD, 0 }, /* kernel */ { 'f', "", forceLineEditing, (void *)2, 0 }, /* probably library now */ { 'E', "", toggle, &SyUseReadline, 0 }, /* kernel */ @@ -1839,7 +1821,6 @@ void InitSystem ( /* Initialize global and static variables. Do it here rather than with initializers to allow for restart */ SyCTRD = 1; - SyCacheSize = 0; SyCheckCRCCompiledModule = 0; SyCompilePlease = 0; SyDebugLoading = 0; diff --git a/src/system.h b/src/system.h index 73cf84c37c..5a47363d74 100644 --- a/src/system.h +++ b/src/system.h @@ -203,22 +203,6 @@ extern const Char * SyBuildDateTime; extern UInt SyCTRD; -/**************************************************************************** -** -*V SyCacheSize . . . . . . . . . . . . . . . . . . . . . . size of the cache -** -** 'SyCacheSize' is the size of the data cache, in kilobytes -** -** This is per default 0, which means that there is no usuable data cache. -** It is usually changed with the '-c' option in the script that starts GAP. -** -** This value is passed to 'InitBags'. -** -** Put in this package because the command line processing takes place here. -*/ -extern UInt SyCacheSize; - - /**************************************************************************** ** *V SyCheckCRCCompiledModule . . . check crc while loading compiled modules