Use u64 for file offsets in IO and calculate such offsets in u64

This commit is contained in:
PThorpe92
2025-08-25 20:15:45 -04:00
parent 2ea4354afe
commit 0a56d23402
15 changed files with 202 additions and 113 deletions

View File

@@ -81,7 +81,7 @@ pub async fn db_bootstrap<C: ProtocolIO, Ctx>(
while !c.is_completed() {
coro.yield_(ProtocolCommand::IO).await?;
}
pos += content_len;
pos += content_len as u64;
}
if content.is_done()? {
break;
@@ -1074,7 +1074,7 @@ pub async fn reset_wal_file<Ctx>(
// let's truncate WAL file completely in order for this operation to safely execute on empty WAL in case of initial bootstrap phase
0
} else {
WAL_HEADER + WAL_FRAME_SIZE * (frames_count as usize)
WAL_HEADER as u64 + WAL_FRAME_SIZE as u64 * frames_count
};
tracing::debug!("reset db wal to the size of {} frames", frames_count);
let c = Completion::new_trunc(move |result| {

View File

@@ -59,7 +59,7 @@ impl IoOperations for Arc<dyn turso_core::IO> {
};
tracing::debug!("file truncated: rc={}", rc);
});
let c = file.truncate(len, c)?;
let c = file.truncate(len as u64, c)?;
while !c.is_completed() {
coro.yield_(ProtocolCommand::IO).await?;
}