コード例 #1
0
        protected Slot AllocateSlot(int length)
        {
            Slot reusedSlot = _container.FreespaceManager().AllocateSafeSlot(length);

            if (reusedSlot != null)
            {
                return(reusedSlot);
            }
            return(_container.AppendBytes(length));
        }
コード例 #2
0
ファイル: InMemoryIdSystem.cs プロジェクト: git-thinh/limada
 private Slot AllocateSlot(bool appendToFile, int slotLength)
 {
     if (!appendToFile)
     {
         Slot slot = _container.FreespaceManager().AllocateSafeSlot(slotLength);
         if (slot != null)
         {
             return(slot);
         }
     }
     return(_container.AppendBytes(slotLength));
 }