Skip to content
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
7 changes: 2 additions & 5 deletions crates/stdlib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ mod _asyncio;
pub mod array;
mod binascii;
mod bisect;
mod bz2;
mod cmath;
mod compression; // internal module
mod contextvars;
mod csv;
mod gc;

mod bz2;
mod compression; // internal module
#[cfg(not(any(target_os = "android", target_arch = "wasm32")))]
mod lzma;
mod zlib;
Expand Down Expand Up @@ -126,7 +124,6 @@ pub fn stdlib_module_defs(ctx: &Context) -> Vec<&'static builtins::PyModuleDef>
faulthandler::module_def(ctx),
#[cfg(any(unix, target_os = "wasi"))]
fcntl::module_def(ctx),
gc::module_def(ctx),
#[cfg(all(unix, not(any(target_os = "android", target_os = "redox"))))]
grp::module_def(ctx),
hashlib::module_def(ctx),
Expand Down
2 changes: 1 addition & 1 deletion crates/vm/src/object/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ impl PyObject {
/// Check if the object has been finalized (__del__ already called).
/// _PyGC_FINALIZED in Py_GIL_DISABLED mode.
#[inline]
pub fn gc_finalized(&self) -> bool {
pub(crate) fn gc_finalized(&self) -> bool {
GcBits::from_bits_retain(self.0.gc_bits.load(Ordering::Relaxed)).contains(GcBits::FINALIZED)
}

Expand Down
3 changes: 1 addition & 2 deletions crates/stdlib/src/gc.rs → crates/vm/src/stdlib/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pub(crate) use gc::module_def;

#[pymodule]
mod gc {
use crate::vm::{
use crate::{
PyObjectRef, PyResult, VirtualMachine,
builtins::PyListRef,
function::{FuncArgs, OptionalArg},
Expand Down Expand Up @@ -205,7 +205,6 @@ mod gc {
/// Return True if the object has been finalized by the garbage collector.
#[pyfunction]
fn is_finalized(obj: PyObjectRef) -> bool {
// Check the per-object finalized flag directly
obj.gc_finalized()
}

Expand Down
2 changes: 2 additions & 0 deletions crates/vm/src/stdlib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ mod codecs;
mod collections;
pub mod errno;
mod functools;
mod gc;
mod imp;
pub mod io;
mod itertools;
Expand Down Expand Up @@ -84,6 +85,7 @@ pub fn builtin_module_defs(ctx: &Context) -> Vec<&'static PyModuleDef> {
ctypes::module_def(ctx),
errno::module_def(ctx),
functools::module_def(ctx),
gc::module_def(ctx),
imp::module_def(ctx),
io::module_def(ctx),
itertools::module_def(ctx),
Expand Down
Loading