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

core: Add priv::chan_from_global_ptr #2136

Closed
wants to merge 1 commit into from
Closed

Conversation

brson
Copy link
Contributor

@brson brson commented Apr 5, 2012

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.

@brson brson 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`.

Closes rust-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.

Fixes rust-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.
Sign up for free to 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