MCPcopy Index your code
hub / github.com/cloud-hypervisor/cloud-hypervisor / as_bytes

Method as_bytes

block/src/aligned_operation.rs:54–59  ·  view source on GitHub ↗

Returns the aligned buffer as a slice.

(&self)

Source from the content-addressed store, hash-verified

52
53 /// Returns the aligned buffer as a slice.
54 pub fn as_bytes(&self) -> &[u8] {
55 // SAFETY: `new` allocates `size` bytes via alloc_zeroed (so they
56 // are initialized) and AlignedOperation owns the buffer
57 // exclusively.
58 unsafe { std::slice::from_raw_parts(self.aligned_ptr, self.size) }
59 }
60
61 /// Returns the aligned buffer as a mutable slice.
62 pub fn as_bytes_mut(&mut self) -> &mut [u8] {

Callers 15

write_stringFunction · 0.80
from_strMethod · 0.80
create_file_nameFunction · 0.80
create_acpi_loaderFunction · 0.80
dma_read_contentMethod · 0.80
test_string_itemFunction · 0.80
logMethod · 0.80
disk_newMethod · 0.80
_test_ivshmemFunction · 0.80
if_name_as_strMethod · 0.80
pnet_send_packetFunction · 0.80

Calls

no outgoing calls