Skip to content

Commit

Permalink
Ensures padding to a multiple of 64 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
paddyhoran committed Feb 6, 2019
1 parent 4004b72 commit 05cb0e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rust/arrow/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ impl<T: AsRef<[u8]>> From<T> for Buffer {
// allocate aligned memory buffer
let slice = p.as_ref();
let len = slice.len() * mem::size_of::<u8>();
let buffer = memory::allocate_aligned(len).unwrap();
let capacity = bit_util::round_upto_multiple_of_64(len);
let buffer = memory::allocate_aligned(capacity).unwrap();
unsafe {
memory::memcpy(buffer, slice.as_ptr(), len);
}
Expand Down

0 comments on commit 05cb0e9

Please sign in to comment.