Optimize GC for motions.
This commit is contained in:
@@ -116,11 +116,6 @@ namespace Cryville.Crtr.Event {
|
|||||||
r.Values = mvs;
|
r.Values = mvs;
|
||||||
|
|
||||||
var cvs = new Dictionary<Identifier, MotionCache>(ChartPlayer.motionRegistry.Count);
|
var cvs = new Dictionary<Identifier, MotionCache>(ChartPlayer.motionRegistry.Count);
|
||||||
foreach (var cv in CachedValues) {
|
|
||||||
var dv = r.MCPool.Rent(cv.Key);
|
|
||||||
cv.Value.CopyTo(dv);
|
|
||||||
cvs.Add(cv.Key, dv);
|
|
||||||
}
|
|
||||||
r.CachedValues = cvs;
|
r.CachedValues = cvs;
|
||||||
|
|
||||||
r.Children = new Dictionary<EventContainer, ContainerState>();
|
r.Children = new Dictionary<EventContainer, ContainerState>();
|
||||||
@@ -190,10 +185,12 @@ namespace Cryville.Crtr.Event {
|
|||||||
if (Disposed) return;
|
if (Disposed) return;
|
||||||
Disposed = true;
|
Disposed = true;
|
||||||
if (CloneType == 1) Handler.Dispose();
|
if (CloneType == 1) Handler.Dispose();
|
||||||
|
if (CloneType == 1 || CloneType == 17) {
|
||||||
|
RMVPool.ReturnAll();
|
||||||
|
MCPool.ReturnAll();
|
||||||
|
}
|
||||||
foreach (var s in Children)
|
foreach (var s in Children)
|
||||||
s.Value.Dispose();
|
s.Value.Dispose();
|
||||||
RMVPool.ReturnAll();
|
|
||||||
MCPool.ReturnAll();
|
|
||||||
}
|
}
|
||||||
public void DisposeAll() {
|
public void DisposeAll() {
|
||||||
foreach (var s in Children)
|
foreach (var s in Children)
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
_buckets[obj.Value].Return(obj.Key);
|
_buckets[obj.Value].Return(obj.Key);
|
||||||
_rented.Clear();
|
_rented.Clear();
|
||||||
_dictPool.Return(_rented);
|
_dictPool.Return(_rented);
|
||||||
|
_rented = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ namespace Cryville.Crtr.Event {
|
|||||||
_buckets[obj.Value].Return(obj.Key);
|
_buckets[obj.Value].Return(obj.Key);
|
||||||
_rented.Clear();
|
_rented.Clear();
|
||||||
_dictPool.Return(_rented);
|
_dictPool.Return(_rented);
|
||||||
|
_rented = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -911,11 +911,11 @@ namespace Cryville.Crtr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override bool IsZero() {
|
public override bool IsZero() {
|
||||||
if (!xw.Equals(0)) return false;
|
if (xw == null || xw != 0) return false;
|
||||||
if (!xh.Equals(0)) return false;
|
if (xh == null || xh != 0) return false;
|
||||||
if (!yw.Equals(0)) return false;
|
if (yw == null || yw != 0) return false;
|
||||||
if (!yh.Equals(0)) return false;
|
if (xh == null || xh != 0) return false;
|
||||||
if (!z.Equals(0)) return false;
|
if (z == null || z != 0) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user