Skip to content

core: Add priv::chan_from_global_ptr - #2136

Closed
brson wants to merge 1 commit into
rust-lang:masterfrom
brson:priv
Closed

core: Add priv::chan_from_global_ptr#2136
brson wants to merge 1 commit into
rust-lang:masterfrom
brson:priv

Conversation

@brson

@brsonbrson commented Apr 5, 2012

Copy link
Copy Markdown
Contributor

This allows singleton, globally accessible tasks to be created, for the purpose of creating a global, default I/O loop.

It's a function that takes a pointer to a pointer-sized memory location, a task builder, and a task function, and returns a singleton channel to another task. It uses compare and swap.

For uv to use it we will have a single uintptr_t field on rust_kernel called global_io_chan to hold the handle.

It's in the priv mod because I couldn't think of where else to put it. It is not intended to be a public API.

@brsonbrson closed this Apr 7, 2012
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 22, 2022
Update GetSystemInfo to work with `page_size` (rust-lang#2136)
- Change logic in GetSystemInfo shim to take into account the two possible layouts of `SYSTEM_INFO`, the first-field-is-union used by [winapi::um::sysinfoapi::SYSTEM_INFO](https://docs.rs/winapi/latest/winapi/um/sysinfoapi/struct.SYSTEM_INFO.html), and first-two-fields-are-inlined-union used by [num_cpus](https://github.com/seanmonstar/num_cpus/blob/5f1b03332000b4c4274b5bd35fac516049ff1c6b/src/lib.rs#L206).
- Fill out the `dwPageSize` field with the `PAGE_SIZE` constant of `4096`.
Closesrust-lang#2136
RalfJung pushed a commit to RalfJung/rust that referenced this pull request Jun 29, 2023
Dereference pointers in shims as correct types
Currently, shims will dereference pointers as the type written by the user. This can cause false positives, incorrect behavior such as rust-lang#2136, and even ICEs if a field is not present.
This PR fixes this by having shims dereference pointers with types from `std` or `libc` that we can rely on the layout and field names of instead of with whatever the user passed in.
Fixesrust-lang#1123
celinval added a commit to celinval/rust-dev that referenced this pull request Jun 4, 2024
Update the RFC to capture the current state of the MIR linker and mark it as Stable.
Kobzol pushed a commit to Kobzol/rust that referenced this pull request Dec 30, 2024
bors pushed a commit to rust-lang-ci/rust that referenced this pull request Jan 2, 2025
folkertdev pushed a commit to folkertdev/rust that referenced this pull request May 25, 2026
Several fixes to the loongarch CRC intrinsics
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
2136: Fix typo in xtask/src/main.rs. r=kjeremy a=krk
Co-authored-by: krk <keremkat@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@brson