-
Notifications
You must be signed in to change notification settings - Fork 29
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
offset_of! consumes too much stack space in dev build #49
Comments
Hm, that is unfortunate. But also I do not think there currently is a way to do
If you are okay with using nightly Rust, an option might be to run |
Maybe we could create a single Example code (which is accepted by Miri): Only problem is that it'd be hard to determine how large this buffer needs to be. Might be an insurmountable problem. |
offset_of! (and probably the other macros in this crate) consumes too much stack space in dev build, especially when the type is big. It's probably because it's declaring a (uninitialized) variable of the type. It's optimized out in the release build.
It affects my workflow in developing an OS in Rust. Its dev build won't boot because offset_of! of a big struct (2KiB) used up the limited amount of kernel stack (4KiB), incurring stack overflow.
The text was updated successfully, but these errors were encountered: