#protobuf #rust use align parameter in __pb_rust_alloc

PiperOrigin-RevId: 613181914
pull/16076/head
Jakob Buchgraber 11 months ago committed by Copybara-Service
parent 11bbab1664
commit 997281b5bb
  1. 2
      rust/cpp_kernel/rust_alloc_for_cpp_api.rs

@ -14,7 +14,7 @@ extern "C" fn __pb_rust_alloc(size: usize, align: usize) -> *mut u8 {
// it so return a dangling pointer instead.
std::ptr::null_mut::<u8>().wrapping_add(align)
} else {
let layout = Layout::from_size_align(size, 1).unwrap();
let layout = Layout::from_size_align(size, align).unwrap();
unsafe { alloc(layout) }
}
}

Loading…
Cancel
Save