Beispiel #1
0
      private static void objectDied(LifeTime lifeTime, int index)
      {
          // put a new fresh object instead;

          ObjectWrapper oWrapper = lifeTime as ObjectWrapper;

          oWrapper.CleanUp();

          oWrapper          = new ObjectWrapper(runFinalizer, oWrapper.IsPinned(), oWrapper.IsWeak());
          oWrapper.LifeTime = lifeTime.LifeTime;
          oWrapper.DataSize = lifeTime.LifeTime == LifeTimeENUM.Short ? shortDataSize : mediumDataSize;

          lifeTimeManager.AddObject(oWrapper, index);
      }
Beispiel #2
0
        private static void objectDied(LifeTime lifeTime, int index)
        {
            // put a new fresh object instead;

            LifeTimeENUM lifeTimeEnum;

            lifeTimeEnum = lifeTime.LifeTime;

            ObjectWrapper oWrapper       = lifeTime as ObjectWrapper;
            bool          weakReferenced = oWrapper.IsWeak();
            bool          pinned         = oWrapper.IsPinned();

            if (pinned)
            {
                oWrapper.CleanUp();
            }

            oWrapper          = new ObjectWrapper(runFinalizer, pinned, weakReferenced);
            oWrapper.LifeTime = lifeTimeEnum;
            oWrapper.DataSize = lifeTime.LifeTime == LifeTimeENUM.Short ? shortDataSize : mediumDataSize;
            lifeTimeManager.AddObject(oWrapper, index);
        }