mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-21 07:00:38 +00:00
@@ -5,6 +5,7 @@ use std::{
|
||||
|
||||
use super::{alignment::Alignment, raw::RawAlignedBuffer};
|
||||
|
||||
/// An shared, immutable aligned buffer type.
|
||||
pub struct AlignedBuffer<A: Alignment> {
|
||||
/// Shared raw buffer.
|
||||
raw: Arc<RawAlignedBuffer<A>>,
|
||||
|
||||
@@ -6,6 +6,7 @@ use super::{
|
||||
raw::RawAlignedBuffer,
|
||||
};
|
||||
|
||||
/// A mutable aligned buffer type.
|
||||
#[derive(Debug)]
|
||||
pub struct AlignedBufferMut<A: Alignment> {
|
||||
raw: RawAlignedBuffer<A>,
|
||||
@@ -207,7 +208,7 @@ fn panic_advance(idx: usize, len: usize) -> ! {
|
||||
);
|
||||
}
|
||||
|
||||
/// Safety: [`IoBufferMut`] has exclusive ownership of the io buffer,
|
||||
/// Safety: [`AlignedBufferMut`] has exclusive ownership of the io buffer,
|
||||
/// and the location remains stable even if [`Self`] is moved.
|
||||
unsafe impl<A: Alignment> tokio_epoll_uring::IoBuf for AlignedBufferMut<A> {
|
||||
fn stable_ptr(&self) -> *const u8 {
|
||||
|
||||
@@ -16,7 +16,7 @@ unsafe impl Send for AlignedBufferPtr {}
|
||||
// SAFETY: We gurantees no one besides `IoBufferPtr` itself has the raw pointer.
|
||||
unsafe impl Sync for AlignedBufferPtr {}
|
||||
|
||||
/// An aligned buffer type used for I/O.
|
||||
/// An aligned buffer type.
|
||||
#[derive(Debug)]
|
||||
pub struct RawAlignedBuffer<A: Alignment> {
|
||||
ptr: AlignedBufferPtr,
|
||||
|
||||
Reference in New Issue
Block a user