From 5dbb8800a886d450471157fdf28191aa64881e11 Mon Sep 17 00:00:00 2001 From: Leesoo Ahn Date: Fri, 17 Jul 2026 13:35:24 +0900 Subject: [PATCH 1/2] vm: replace fetch_update() with try_update() fetch_update() in atomic namespace is in the deprecation stage. --- crates/vm/src/builtins/function.rs | 2 +- crates/vm/src/builtins/type.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/vm/src/builtins/function.rs b/crates/vm/src/builtins/function.rs index 47fda299455..af359f11190 100644 --- a/crates/vm/src/builtins/function.rs +++ b/crates/vm/src/builtins/function.rs @@ -87,7 +87,7 @@ static FUNC_VERSION_COUNTER: AtomicU32 = AtomicU32::new(1); /// Once the counter wraps to 0, it stays at 0 permanently. fn next_func_version() -> u32 { FUNC_VERSION_COUNTER - .fetch_update(Relaxed, Relaxed, |v| (v != 0).then(|| v.wrapping_add(1))) + .try_update(Relaxed, Relaxed, |v| (v != 0).then(|| v.wrapping_add(1))) .unwrap_or(0) } diff --git a/crates/vm/src/builtins/type.rs b/crates/vm/src/builtins/type.rs index 3d9228b805f..c27c6475f42 100644 --- a/crates/vm/src/builtins/type.rs +++ b/crates/vm/src/builtins/type.rs @@ -680,7 +680,7 @@ impl PyType { let flags_bits = flags.bits(); let _ = self .abc_tpflags - .fetch_update(Ordering::AcqRel, Ordering::Acquire, |old| { + .try_update(Ordering::AcqRel, Ordering::Acquire, |old| { Some((old & !collection_bits) | flags_bits) }); self.modified(); From 49255176dedd382e8de379fd02d6a179342a8e51 Mon Sep 17 00:00:00 2001 From: Leesoo Ahn Date: Fri, 17 Jul 2026 13:38:56 +0900 Subject: [PATCH 2/2] host_env: replace libc::RLIM_NLIMITS with const RLIM_NLIMITS Define a new const, RLIM_NLIMITS instead of libc::RLIM_NLIMITS in order to clean up the deprecated const and to prevent breaking API where the const is still used. --- crates/host_env/src/resource.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/host_env/src/resource.rs b/crates/host_env/src/resource.rs index a0ba79b1b6b..fdf4e1e6288 100644 --- a/crates/host_env/src/resource.rs +++ b/crates/host_env/src/resource.rs @@ -7,9 +7,6 @@ pub use libc::{ RLIMIT_NOFILE, RLIMIT_NPROC, RLIMIT_RSS, RLIMIT_STACK, c_long, rlim_t, rlimit, timeval, }; -#[cfg(target_os = "android")] -pub use libc::RLIM_NLIMITS; - #[cfg(any(target_os = "linux", target_os = "android", target_os = "emscripten"))] pub use libc::{RLIMIT_MSGQUEUE, RLIMIT_NICE, RLIMIT_RTPRIO, RLIMIT_SIGPENDING}; @@ -36,6 +33,9 @@ pub use libc::RUSAGE_THREAD; #[cfg(not(any(target_os = "windows", target_os = "redox")))] pub use libc::{RUSAGE_CHILDREN, RUSAGE_SELF}; +#[cfg(target_os = "android")] +pub const RLIM_NLIMITS: libc::c_int = 16; + #[derive(Debug, Clone, Copy)] pub struct RUsage { pub ru_utime: libc::timeval,