1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) 2026 Mike Grier
// Copied from windows-ioring-sys src/numa_buffer_io.rs at b6ba19e5.
//! `io-buffers`' I/O buffer traits, implemented for [`NumaBuffer`].
//!
//! # Why the impls are here
//!
//! A trait may be implemented for a type only by the crate that owns the trait or the crate that
//! owns the type. `io-buffers` owns the traits and this crate owns the type, and `io-buffers` is
//! portable and cannot depend on a Windows allocator, so the impls are here. They are two lines each
//! and delegate to [`NumaBuffer`]'s inherent accessors, which are public, so a crate that owns a
//! buffer trait of its own can implement it the same way.
use ;
use crateNumaBuffer;
// SAFETY: the allocation's address is fixed once `VirtualAllocExNuma` returns
// it and does not move for the value's life; the requested length is fixed
// too. `NumaBuffer` is `Send`, which `IoBuf` requires.
unsafe
// SAFETY: a `NumaBuffer` uniquely owns its allocation, so `&mut self` is
// exclusive access to the bytes; the address is the same one `stable_ptr`
// reports, because both return the allocation's base.
unsafe