本文整理汇总了C#中Btree.Deallocate方法的典型用法代码示例。如果您正苦于以下问题:C# Btree.Deallocate方法的具体用法?C# Btree.Deallocate怎么用?C# Btree.Deallocate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Btree
的用法示例。
在下文中一共展示了Btree.Deallocate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Sweep
private int Sweep()
{
int nDeallocated = 0;
long pos;
gcDone = true;
for (int i = dbFirstUserId, j = committedIndexSize; i < j; i++)
{
pos = GetGCPos(i);
if (pos != 0 && ((int) pos & (dbPageObjectFlag | dbFreeHandleFlag)) == 0)
{
int bit = (int) (SupportClass.URShift(pos, dbAllocationQuantumBits));
if ((blackBitmap[SupportClass.URShift(bit, 5)] & (1 << (bit & 31))) == 0)
{
// object is not accessible
if (GetPos(i) != pos)
{
throw new StorageError(StorageError.INVALID_OID);
}
int offs = (int) pos & (Page.pageSize - 1);
Page pg = pool.GetPage(pos - offs);
int typeOid = ObjectHeader.GetType(pg.data, offs);
if (typeOid != 0)
{
ClassDescriptor desc = FindClassDescriptor(typeOid);
nDeallocated += 1;
if (typeof(Btree).IsAssignableFrom(desc.cls))
{
Btree btree = new Btree(pg.data, ObjectHeader.Sizeof + offs);
pool.Unfix(pg);
btree.AssignOid(this, i, false);
btree.Deallocate();
}
else
{
int size = ObjectHeader.GetSize(pg.data, offs);
pool.Unfix(pg);
FreeId(i);
objectCache.Remove(i);
CloneBitmap(pos, size);
}
if (listener != null)
{
listener.DeallocateObject(desc.cls, i);
}
}
}
}
}
greyBitmap = null;
blackBitmap = null;
allocatedDelta = 0;
gcActive = false;
if (listener != null)
listener.GcCompleted(nDeallocated);
return nDeallocated;
}