Skip to content
Open
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
8 changes: 0 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ mac_address = "1.1.3"
malachite-bigint = "0.9.1"
malachite-q = "0.9.1"
malachite-base = "0.9.1"
maplit = "1.0.2"
md-5 = "0.10.1"
memchr = "2.8.0"
memmap2 = "0.9.10"
Expand All @@ -250,7 +249,6 @@ openssl = "0.10.79"
openssl-sys = "0.9.110"
openssl-probe = "0.2.1"
optional = "0.5"
page_size = "0.6"
parking_lot = "0.12.3"
paste = "1.0.15"
pbkdf2 = "0.12"
Expand All @@ -265,7 +263,7 @@ radium = "1.1.1"
rand = "0.9"
rand_core = { version = "0.9", features = ["os_rng"] }
result-like = "0.5.0"
rustix = { version = "1.1", features = ["event", "system"] }
rustix = { version = "1.1", features = ["event", "param", "system"] }
rustls = { version = "0.23.39", default-features = false }
rustls-native-certs = "0.8"
rustls-pemfile = "2.2"
Expand Down
1 change: 0 additions & 1 deletion crates/derive-impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ rustpython-doc = { workspace = true }
itertools = { workspace = true }
syn = { workspace = true, features = ["full", "extra-traits"] }

maplit = { workspace = true }
proc-macro2 = { workspace = true }
quote = { workspace = true }
syn-ext = { workspace = true, features = ["full"] }
Expand Down
8 changes: 5 additions & 3 deletions crates/derive-impl/src/compile_bytecode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,14 @@ impl CompilationSource {
CompilationSourceKind::Dir { base, rel_path } => {
self.compile_dir(base, &base.join(rel_path), "", mode, compiler)
}
_ => Ok(hashmap! {
module_name.to_string() => CompiledModule {
_ => Ok(core::iter::once((
module_name.to_string(),
CompiledModule {
code: self.compile_single(mode, module_name, compiler)?,
package: false,
},
}),
))
.collect()),
}
}

Expand Down
3 changes: 0 additions & 3 deletions crates/derive-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

extern crate proc_macro;

#[macro_use]
extern crate maplit;

#[macro_use]
mod error;
#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion crates/stdlib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

# tkinter
tk-sys = { workspace = true, optional = true }
tcl-sys = { workspace = true, optional = true }

Check warning on line 95 in crates/stdlib/Cargo.toml

View workflow job for this annotation

GitHub Actions / cargo shear

shear/unused_optional_dependency

unused optional dependency `tcl-sys`
widestring = { workspace = true, optional = true }
chrono.workspace = true

Expand All @@ -110,7 +110,6 @@
# mmap + socket dependencies
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
memmap2 = { workspace = true }
page_size = { workspace = true }
gethostname = { workspace = true }
socket2 = { workspace = true, features = ["all"] }
dns-lookup = { workspace = true }
Expand All @@ -125,8 +124,8 @@
rustls = { workspace = true, default-features = false, features = ["std", "tls12", "aws_lc_rs"], optional = true }
rustls-native-certs = { workspace = true, optional = true }
rustls-pemfile = { workspace = true, optional = true }
rustls-platform-verifier = { workspace = true, optional = true }

Check warning on line 127 in crates/stdlib/Cargo.toml

View workflow job for this annotation

GitHub Actions / cargo shear

shear/unused_optional_dependency

unused optional dependency `rustls-platform-verifier`
x509-cert = { workspace = true, features = ["pem", "builder"], optional = true }

Check warning on line 128 in crates/stdlib/Cargo.toml

View workflow job for this annotation

GitHub Actions / cargo shear

shear/unused_optional_dependency

unused optional dependency `x509-cert`
x509-parser = { workspace = true, optional = true }
der = { workspace = true, optional = true }
pem-rfc7468 = { workspace = true, features = ["alloc"], optional = true }
Expand Down Expand Up @@ -159,6 +158,7 @@
"Win32_System_Console",
"Win32_System_IO",
"Win32_System_Memory",
"Win32_System_SystemInformation",
"Win32_System_Threading"
]

Expand Down
45 changes: 40 additions & 5 deletions crates/stdlib/src/mmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ mod mmap {
CreateFileMappingW, FILE_MAP_COPY, FILE_MAP_READ, FILE_MAP_WRITE, FlushViewOfFile,
MapViewOfFile, PAGE_READONLY, PAGE_READWRITE, PAGE_WRITECOPY, UnmapViewOfFile,
},
System::Threading::GetCurrentProcess,
System::{
SystemInformation::{GetSystemInfo, SYSTEM_INFO},
Threading::GetCurrentProcess,
},
};

#[cfg(unix)]
Expand Down Expand Up @@ -180,16 +183,48 @@ mod mmap {
#[pyattr]
const ACCESS_COPY: u32 = AccessMode::Copy as u32;

#[cfg(not(target_arch = "wasm32"))]
#[cfg(unix)]
#[pyattr(name = "PAGESIZE", once)]
fn page_size(_vm: &VirtualMachine) -> usize {
page_size::get()
rustix::param::page_size()
}

#[cfg(target_arch = "wasm32")]
#[pyattr(name = "PAGESIZE", once)]
const fn page_size(_vm: &VirtualMachine) -> usize {
65536
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

#[cfg(windows)]
#[pyattr(name = "PAGESIZE", once)]
fn page_size(_vm: &VirtualMachine) -> usize {
let mut info = SYSTEM_INFO::default();
unsafe {
GetSystemInfo(&mut info);
}
info.dwPageSize as _
}

#[cfg(not(target_arch = "wasm32"))]
#[cfg(unix)]
#[pyattr(name = "ALLOCATIONGRANULARITY", once)]
fn granularity(_vm: &VirtualMachine) -> usize {
rustix::param::page_size()
}

#[cfg(target_arch = "wasm32")]
#[pyattr(name = "ALLOCATIONGRANULARITY", once)]
const fn granularity(_vm: &VirtualMachine) -> usize {
65536
}

#[cfg(windows)]
#[pyattr(name = "ALLOCATIONGRANULARITY", once)]
fn granularity(_vm: &VirtualMachine) -> usize {
page_size::get_granularity()
let mut info = SYSTEM_INFO::default();
unsafe {
GetSystemInfo(&mut info);
}
info.dwAllocationGranularity as _
}

#[pyattr(name = "error", once)]
Expand Down
Loading