// When a file gets opened, it uses the file size to determine where // new slots can be appended. If this method would not be called, the // freespace system could already contain a slot that points beyond // the end of the file and this space could be allocated and used twice, // for instance if a slot was allocated and freed without ever being // written to file. void ensureLastSlotWritten() { if (!Debug4.xbytes) { if (Deploy.overwrite) { if (_blockEndAddress > _blockConverter.bytesToBlocks(fileLength())) { StatefulBuffer writer = createStatefulBuffer(systemTransaction(), _blockEndAddress - 1, blockSize()); writer.write(); } } } }