public Slot allocateSlot(int length) { if (length <= 0) { throw new IllegalArgumentException(); } if (_freespaceManager != null && _freespaceManager.isStarted()) { Slot slot = _freespaceManager.allocateSlot(length); if (slot != null) { if (DTrace.enabled) { DTrace.GET_SLOT.logLength(slot.address(), slot.length()); } return slot; } while (growDatabaseByConfiguredSize()) { slot = _freespaceManager.allocateSlot(length); if (slot != null) { if (DTrace.enabled) { DTrace.GET_SLOT.logLength(slot.address(), slot.length()); } return slot; } } } Slot appendedSlot = appendBytes(length); if (DTrace.enabled) { DTrace.GET_SLOT.logLength(appendedSlot.address(), appendedSlot.length()); } return appendedSlot; }