Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Oct 21, 2024
1 parent 75e9ad4 commit ee47627
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion crates/polars-io/src/mmap.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::fs::File;
use std::io::{BufReader, Cursor, Read, Seek};
use std::sync::Arc;

use polars_core::config::verbose;
use polars_utils::mmap::{MMapSemaphore, MemSlice};
Expand Down Expand Up @@ -87,6 +86,11 @@ impl std::ops::Deref for ReaderBytes<'_> {
/// `MemSlice` from the `ReaderBytes` in a zero-copy manner regardless of the underlying enum
/// variant.
impl ReaderBytes<'static> {
/// Construct a `MemSlice` in a zero-copy manner from the underlying bytes, with the assumption
/// that the underlying bytes have a `'static` lifetime. This is marked as unsafe despite having
/// a `'static` inner lifetime, as the `Owned(Vec<u8>)` variant is not covered by the lifetime
/// guarantee.
///
/// # Safety
/// `Self` outlives the returned `MemSlice` if this enum variant is an `Owned(Vec<u8>)`.
pub unsafe fn to_static_slice(&self) -> MemSlice {
Expand Down
1 change: 0 additions & 1 deletion crates/polars-io/src/parquet/read/read_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use polars_parquet::parquet::statistics::Statistics;
use polars_parquet::read::{
self, ColumnChunkMetadata, FileMetadata, Filter, PhysicalType, RowGroupMetadata,
};
use polars_utils::mmap::MemSlice;
use rayon::prelude::*;

#[cfg(feature = "cloud")]
Expand Down

0 comments on commit ee47627

Please sign in to comment.