/// <summary> /// Initializes a new instance, using the inherited GC Listener properties as /// appropriate. /// </summary> /// <param name="owner"></param> /// <param name="key"></param> internal Bucket(SoftValueBucketDictionary <TKey, TValue> owner, TKey key) { Key = key; SoftValues = new SoftList <TValue>(owner._ValuesComparer); SoftValues.GCCycles = owner.GCCycles; SoftValues.GCTicks = owner.GCTicks; }
/// <summary> /// Initializes a new instance, capturing the key's hash code, and using the /// inherited GC Listener properties as appropriate. /// </summary> /// <param name="owner"></param> /// <param name="key"></param> internal Bucket(SoftBucketDictionary <TKey, TValue> owner, TKey key) { HashCode = owner._KeysComparer.GetHashCode(key); SoftKey = new SoftReference(key); SoftKey.GCCycles = owner.GCCycles; SoftKey.GCTicks = owner.GCTicks; SoftValues = new SoftList <TValue>(owner._ValuesComparer); SoftValues.GCCycles = owner.GCCycles; SoftValues.GCTicks = owner.GCTicks; }