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

Added RFC on dereferencing *T #43

Closed
wants to merge 1 commit into from

Conversation

farcaller
Copy link

No description provided.

@huonw
Copy link
Member

huonw commented Apr 14, 2014

I'm not in favour of this. Unsafe code is already hard to get right, let alone adding new sources of non-explicitness which can't easily be checked at the source level.

```

In this case, accessing methods on `UART0` is done with simple syntax, but the actual
`static UART0` gets into output binary (as u32 0xdeadbeef), which requres developer to make a trade between syntax and binary size.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like the more fundamental problem, and the one that would fix your issue: Rust doesn't offer flexible enough control over statics to be able to use safe(r) wrappers for this use case.

(That said, it is just essentially just 8 bytes in rodata, right?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 4 bytes in rodata, four more instructions to fetch the address from there at each call invocation. That isn't critically significant, but easily adds useless weight to binary.

@farcaller
Copy link
Author

Deprecating this in favour of #44

@farcaller farcaller closed this Apr 14, 2014
withoutboats pushed a commit to withoutboats/rfcs that referenced this pull request Jan 15, 2017
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.

2 participants