void (final int startOffsetModified, final int length) { assert contentProtectingLock.writeLock().isHeldByCurrentThread() : "writeLock must be held while calling this method"; final long modifiedRegionNew; final long modifiedRegionOld; synchronized (this) { modifiedRegionOld = modifiedRegionPacked; final int minOffsetModifiedOld = unpackMinOffsetModified(modifiedRegionOld); final int maxOffsetModifiedOld = unpackMaxOffsetModifiedExclusive(modifiedRegionOld); final int minOffsetModifiedNew = Math.min(minOffsetModifiedOld, startOffsetModified); final int endOffset = startOffsetModified + length; final int maxOffsetModifiedNew = Math.max(maxOffsetModifiedOld, endOffset); if (minOffsetModifiedOld == minOffsetModifiedNew && maxOffsetModifiedOld == maxOffsetModifiedNew) { return; } modifiedRegionNew = ((long)minOffsetModifiedNew) | (((long)maxOffsetModifiedNew) << Integer.SIZE); this.modifiedRegionPacked = modifiedRegionNew; } storageHandle.modifiedRegionUpdated( offsetInFile() + startOffsetModified, length ); if (modifiedRegionOld == 0 && modifiedRegionNew != 0) { storageHandle.pageBecomeDirty(); } }