Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid struct<Generic = ()> in cbindgen-read definitions #951

Merged
merged 2 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ipc/src/rate_limiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct ShmLimiterData<'a, Inner> {
_phantom: PhantomData<&'a ShmLimiterMemory<Inner>>,
}

pub struct ShmLimiterMemory<Inner = ()> {
pub struct ShmLimiterMemory<Inner> {
mem: Arc<RwLock<MappedMem<NamedShmHandle>>>,
last_size: AtomicU32,
_phantom: PhantomData<Inner>,
Expand Down Expand Up @@ -195,7 +195,7 @@ impl<Inner> ShmLimiterMemory<Inner> {
}
}

pub struct ShmLimiter<Inner = ()> {
pub struct ShmLimiter<Inner> {
idx: u32,
memory: ShmLimiterMemory<Inner>,
}
Expand Down Expand Up @@ -295,7 +295,7 @@ impl<Inner> Drop for ShmLimiter<Inner> {

pub enum AnyLimiter {
Local(LocalLimiter),
Shm(ShmLimiter),
Shm(ShmLimiter<()>),
}

impl AnyLimiter {
Expand Down
2 changes: 1 addition & 1 deletion sidecar/src/shm_remote_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ struct ConfigFileStorage {

struct StoredShmFile {
handle: Mutex<NamedShmHandle>,
limiter: Option<ShmLimiter>,
limiter: Option<ShmLimiter<()>>,
refcount: FileRefcountData,
}

Expand Down
4 changes: 2 additions & 2 deletions sidecar/src/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use std::ffi::CString;
use std::str::FromStr;
use std::sync::{Mutex, OnceLock};

static SHM_LIMITER: OnceLock<Mutex<ShmLimiterMemory>> = OnceLock::new();
static SHM_LIMITER: OnceLock<Mutex<ShmLimiterMemory<()>>> = OnceLock::new();

pub fn get_shm_limiter() -> &'static Mutex<ShmLimiterMemory> {
pub fn get_shm_limiter() -> &'static Mutex<ShmLimiterMemory<()>> {
#[allow(clippy::unwrap_used)]
SHM_LIMITER.get_or_init(|| Mutex::new(ShmLimiterMemory::create(shm_limiter_path()).unwrap()))
}
Expand Down
Loading