コード例 #1
0
        public long Reallocate(long pos, long oldSize, long newSize)
        {
            StorageImpl db = (StorageImpl)Storage;

            if (((newSize + StorageImpl.dbAllocationQuantum - 1) & ~(StorageImpl.dbAllocationQuantum - 1))
                > ((oldSize + StorageImpl.dbAllocationQuantum - 1) & ~(StorageImpl.dbAllocationQuantum - 1)))
            {
                long newPos = db.allocate(newSize, 0);
                db.cloneBitmap(pos, oldSize);
                db.free(pos, oldSize);
                pos = newPos;
            }
            return(pos);
        }