Skip to content
Discussion options

You must be logged in to vote

Does it work in release?

One problem that rust have is that it puts all its structure on the stack before putting it them on the heap.
So when we do Box::new(Foo { ... }) it first creates the Foo on the stack and then moves it to the heap.
Our generated code is actually creating quite a few of these for bindings for example. We think they may be several copies of all of these on the same stack frame in debug mode.
Another thing is that we use const structure for the field offsets. And we have the suspicion that in debug mode, lots of these structures also end up on the stack despite they are const and shouldn't even be created at all.
But we are also unsure of what causes these stack over…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@Futsch1
Comment options

@tronical
Comment options

@tronical
Comment options

Answer selected by Futsch1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants