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

Flip-Link "Stack Overflow Protection" Feasibility? #40

Open
sgeos opened this issue Apr 29, 2023 · 3 comments
Open

Flip-Link "Stack Overflow Protection" Feasibility? #40

sgeos opened this issue Apr 29, 2023 · 3 comments

Comments

@sgeos
Copy link

sgeos commented Apr 29, 2023

The Playdate has a small stack. Is it feasible to bake flip link into crank for "stack overflow protection"?
https://github.com/knurling-rs/flip-link

The main problem appears to be "if you [are] using GNU ld or GNU gcc to link your program then [using the flip-link linker] won't work." crank appears to use gcc for linking.

@rtsuk
Copy link
Collaborator

rtsuk commented Apr 29, 2023

It might also be a problem that the Playdate OS makes the stack for games. I think flip-link expects something different.

@sgeos
Copy link
Author

sgeos commented Apr 30, 2023

A game console is doing something that breaks standard assumptions. No surprise there. I think I might be running into a stack overflow. Do you have any thoughts on working with, working around, and debugging stack-based issues in Rust on the Playdate?

@rtsuk
Copy link
Collaborator

rtsuk commented Apr 30, 2023

Are you using serde in your game? I'm told it is a heavy user of stack space and that matched my experience.

Otherwise, try to use heap allocated data structures as much as possible; Vec instead of arrays, for example.

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

No branches or pull requests

2 participants