public void SetTreePartitionContentsAndPin <T>(IReference <T> emptyPartitionRef, T contents) where T : IStorable { BaseReference baseReference = (BaseReference)emptyPartitionRef; this.m_partitionManager.TreeHasChanged = true; this.CacheItem(baseReference, (IStorable)(object)contents, false, ItemSizes.SizeOf((IStorable)(object)contents)); baseReference.PinValue(); this.CacheSetValue(baseReference.Id, baseReference); }
protected BaseReference AllocateAndPin(IStorable obj, int initialSize) { Global.Tracer.Assert(obj != null, "Cannot allocate reference to null"); BaseReference baseReference = base.CreateReference(obj); baseReference.Init(this, this.GenerateTempId()); this.CacheItem(baseReference, obj, false, initialSize); baseReference.PinValue(); return(baseReference); }
private IReference <T> InternalAllocate <T>(T obj, int priority, bool startPinned, int initialSize) where T : IStorable { Global.Tracer.Assert(obj != null, "Cannot allocate reference to null"); BaseReference baseReference = base.CreateReference((IStorable)(object)obj); baseReference.Init(this, this.m_offsetMap.GenerateTempId()); this.CacheItem(baseReference, (IStorable)(object)obj, priority, initialSize); if (startPinned) { baseReference.PinValue(); } return((IReference <T>)baseReference); }