@@ -118,21 +118,6 @@ module CacheOptions =
118118 CacheOptions.EvictionMode = EvictionMode.NoEviction
119119 }
120120
121- module Cache =
122- // During testing a lot of compilations are started in app domains and subprocesses.
123- // This is a reliable way to pass the override to all of them.
124- [<Literal>]
125- let private overrideVariable = " FSHARP_CACHE_OVERRIDE"
126-
127- /// Use for testing purposes to reduce memory consumption in testhost and its subprocesses.
128- let OverrideCapacityForTesting () =
129- Environment.SetEnvironmentVariable( overrideVariable, " 4096" , EnvironmentVariableTarget.Process)
130-
131- let applyOverride ( options : CacheOptions < _ >) =
132- match Int32.TryParse( Environment.GetEnvironmentVariable( overrideVariable)) with
133- | true , n when options.TotalCapacity > n -> { options with TotalCapacity = n }
134- | _ -> options
135-
136121// It is important that this is not a struct, because LinkedListNode holds a reference to it,
137122// and it holds the reference to that Node, in a circular way.
138123[<Sealed; NoComparison; NoEquality>]
@@ -176,8 +161,6 @@ type Cache<'Key, 'Value when 'Key: not null> internal (options: CacheOptions<'Ke
176161 if options.HeadroomPercentage < 0 then
177162 invalidArg " HeadroomPercentage" " HeadroomPercentage must be positive"
178163
179- let options = Cache.applyOverride options
180-
181164 let name = defaultArg name ( Guid.NewGuid() .ToString())
182165
183166 // Determine evictable headroom as the percentage of total capcity, since we want to not resize the dictionary.
0 commit comments