You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
@ -91,31 +91,20 @@ namespace System.Web.Hosting {
|
||||
if (memoryCache == null) {
|
||||
throw new ArgumentNullException("memoryCache");
|
||||
}
|
||||
long delta = 0;
|
||||
lock (_lock) {
|
||||
if (_cacheInfos != null) {
|
||||
MemoryCacheInfo info = null;
|
||||
if (_cacheInfos.TryGetValue(memoryCache, out info)) {
|
||||
delta = 0 - info.Size;
|
||||
_cacheInfos.Remove(memoryCache);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (delta != 0) {
|
||||
ApplicationManager appManager = HostingEnvironment.GetApplicationManager();
|
||||
if (appManager != null) {
|
||||
ExecutionContextUtil.RunInNullExecutionContext(delegate {
|
||||
appManager.GetUpdatedTotalCacheSize(delta);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void IMemoryCacheManager.UpdateCacheSize(long size, MemoryCache memoryCache) {
|
||||
if (memoryCache == null) {
|
||||
throw new ArgumentNullException("memoryCache");
|
||||
}
|
||||
long delta = 0;
|
||||
lock (_lock) {
|
||||
if (_cacheInfos == null) {
|
||||
_cacheInfos = new Dictionary<MemoryCache, MemoryCacheInfo>();
|
||||
@ -126,15 +115,8 @@ namespace System.Web.Hosting {
|
||||
info.Cache = memoryCache;
|
||||
_cacheInfos[memoryCache] = info;
|
||||
}
|
||||
delta = size - info.Size;
|
||||
info.Size = size;
|
||||
}
|
||||
ApplicationManager appManager = HostingEnvironment.GetApplicationManager();
|
||||
if (appManager != null) {
|
||||
ExecutionContextUtil.RunInNullExecutionContext(delegate {
|
||||
appManager.GetUpdatedTotalCacheSize(delta);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
internal long TrimCache(int percent) {
|
||||
|
Reference in New Issue
Block a user