This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b424e90
commit e6b6c83
Showing
33 changed files
with
270 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use crate::array::ffi::ToFfi; | ||
|
||
use super::FixedSizeBinaryArray; | ||
|
||
unsafe impl ToFfi for FixedSizeBinaryArray { | ||
fn buffers(&self) -> Vec<Option<std::ptr::NonNull<u8>>> { | ||
let offset = self | ||
.validity | ||
.as_ref() | ||
.map(|x| x.offset()) | ||
.unwrap_or_default(); | ||
let offset = offset * self.size(); | ||
|
||
// note that this may point to _before_ the pointer. This is fine because the C data interface | ||
// requires users to only access past the offset | ||
let values = | ||
std::ptr::NonNull::new( | ||
unsafe { self.values.as_ptr().offset(-(offset as isize)) } as *mut u8 | ||
); | ||
|
||
vec![self.validity.as_ref().map(|x| x.as_ptr()), values] | ||
} | ||
} |
Oops, something went wrong.
Was this intended? If so, what has changed when slicing a list array?