Skip to content

proc_macro/bridge: remove client->server &HandleCounters passing.#98223

Closed
eddyb wants to merge 1 commit intorust-lang:masterfrom
eddyb:proc-macro-handle-counters
Closed

proc_macro/bridge: remove client->server &HandleCounters passing.#98223
eddyb wants to merge 1 commit intorust-lang:masterfrom
eddyb:proc-macro-handle-counters

Conversation

@eddyb
Copy link
Copy Markdown
Member

@eddyb eddyb commented Jun 18, 2022

Just like #97461, this was inspired by @nnethercote's efforts in this area (see #97004 (comment)).
The purpose of the counters was never to protect from server-side misuse, only client-side misuse (e.g. a proc macro storing a proc_macro public API type in TLS), so the FIXME comment should suffice for now.

As this PR removes get_handle_counters (the only non-ZST Client field other than run, since #97461), it will allow a #[repr(transparent)] Client that only newtypes the run C ABI entry-point fn pointer (and in the context of e.g. wasm isolation, that's all you want, since you can reason about it from outside the wasm VM, as just a 32-bit "function table index", that you can pass to the wasm VM to call that function).

However, I haven't changed any #[repr] attributes in this PR to avoid unforseen perf interactions.

cc @mystor @bjorn3

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.