int () { dirty.compareAndSet(false, true); final Page headerPage = headerPage(); final ByteBuffer headerPageBuffer = headerPage.rawPageBuffer(); while (true) {// CAS loop: int allocatedRecords = (int)INT_HANDLE.getVolatile(headerPageBuffer, HEADER_RECORDS_ALLOCATED); int newAllocatedRecords = allocatedRecords + 1; if (INT_HANDLE.compareAndSet(headerPageBuffer, HEADER_RECORDS_ALLOCATED, allocatedRecords, newAllocatedRecords)) { return newAllocatedRecords; } } }