comparison src/libpam/memory.rs @ 106:49d9e2b5c189

An irresponsible mix of implementing libpam-sys and other stuff.
author Paul Fisher <paul@pfish.zone>
date Thu, 26 Jun 2025 22:41:28 -0400
parents 13b4d2a19674
children
comparison
equal deleted inserted replaced
105:13b4d2a19674 106:49d9e2b5c189
1 //! Things for dealing with memory. 1 //! Things for dealing with memory.
2 2
3 use crate::Result; 3 use crate::Result;
4 use crate::{BinaryData, ErrorCode}; 4 use crate::{BinaryData, ErrorCode};
5 use memoffset::offset_of;
5 use std::error::Error; 6 use std::error::Error;
6 use std::ffi::{c_char, CStr, CString}; 7 use std::ffi::{c_char, CStr, CString};
7 use std::fmt::{Display, Formatter, Result as FmtResult}; 8 use std::fmt::{Display, Formatter, Result as FmtResult};
8 use std::marker::{PhantomData, PhantomPinned}; 9 use std::marker::{PhantomData, PhantomPinned};
9 use std::mem::{ManuallyDrop}; 10 use std::mem::ManuallyDrop;
10 use std::ops::{Deref, DerefMut}; 11 use std::ops::{Deref, DerefMut};
11 use std::ptr::NonNull; 12 use std::ptr::NonNull;
12 use std::result::Result as StdResult; 13 use std::result::Result as StdResult;
13 use std::{mem, ptr, slice}; 14 use std::{mem, ptr, slice};
14 use memoffset::offset_of;
15 15
16 /// Raised from `calloc` when you have no memory! 16 /// Raised from `calloc` when you have no memory!
17 #[derive(Debug)] 17 #[derive(Debug)]
18 pub struct NoMem; 18 pub struct NoMem;
19 19