-
First of all, thanks a lot for creating sixtyfps and providing this great GUI framework to the community! I really enjoyed creating an application with it. I have an issue when using sixtyfps in version 0.1.6. This version is breaking some of my unit tests where I create a Window struct in a test:
where ImageSieve is the generated struct for my main Window. The test will crash reporting a stack overflow. I tried Box'ing the struct, but no success. See also the actions here https://github.com/Futsch1/image-sieve/actions/runs/1704415977 where the first attempt worked (with v0.1.5) and the second failed (with v0.1.6). Any advice? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
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. |
Beta Was this translation helpful? Give feedback.
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 theFoo
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 areconst
and shouldn't even be created at all.But we are also unsure of what causes these stack over…