Update the object crate to 0.27.0 (#3465)
Mostly just keeping us up to date with changes there since we somewhat heavily rely on it now.
This commit is contained in:
@@ -22,7 +22,7 @@ anyhow = "1.0"
|
||||
cfg-if = "1.0"
|
||||
log = "0.4"
|
||||
gimli = { version = "0.25.0", default-features = false, features = ["std", "read"] }
|
||||
object = { version = "0.26.0", default-features = false, features = ["std", "read_core", "elf"] }
|
||||
object = { version = "0.27.0", default-features = false, features = ["std", "read_core", "elf"] }
|
||||
serde = { version = "1.0.94", features = ["derive"] }
|
||||
addr2line = { version = "0.16.0", default-features = false }
|
||||
ittapi-rs = { version = "0.1.5", optional = true }
|
||||
|
||||
@@ -195,17 +195,13 @@ impl WritableBuffer for ObjectMmap {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn resize(&mut self, new_len: usize, value: u8) {
|
||||
fn resize(&mut self, new_len: usize) {
|
||||
// Resizing always appends 0 bytes and since new mmaps start out as 0
|
||||
// bytes we don't actually need to do anything as part of this other
|
||||
// than update our own length.
|
||||
if new_len <= self.len {
|
||||
return;
|
||||
}
|
||||
let mmap = self.mmap.as_mut().expect("write before reserve");
|
||||
|
||||
// new mmaps are automatically filled with zeros, so if we're asked to
|
||||
// fill with zeros then we can skip the actual fill step.
|
||||
if value != 0 {
|
||||
mmap[self.len..][..new_len - self.len].fill(value);
|
||||
}
|
||||
self.len = new_len;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user