Comments (6)
Ok, yes seems like compiling for the simulator just uses the std functions no matter what.
Maybe we should also try reverting back to switch("os", "any")
compiling for the simulator too.
I remember removing this setting time ago.
from playdate-nim.
I started playing around with using the playdate realloc
method for everything in Nim: Nycto@memory
I've got things working on the simulator, but everything immediately crashes when trying to use it on device. Feel free to poke at this and see if it makes sense.
from playdate-nim.
I thought the _malloc_r
, _realloc_r
and _free_r
definitions in setup.c
(SDK folder) were enough to override the default malloc strategy, but I'm not sure if this is really the case.
What makes you think Nim wasn't using the SDK provided functions?
from playdate-nim.
This might just be a simulator thing, actually. When I completely comment out all the memory allocation functions in setup.c
, I'm still able to compile and run the simulator. But I just tried compiling for the device and it looks like it's failing appropriately
from playdate-nim.
I have to admit to being a bit stumped so far. I’ve tried various compiler and linker flags, but nothing seems to impact the simulator. If you get a chance to look at this, I would love a second set of eyes.
from playdate-nim.
Since I was stuck, I switched back to working on this branch: https://github.com/Nycto/playdate-nim/tree/memory
I got it mostly working, though I still have one workflow failure to investigate. I think this might be the right path forward as it’s the official Nim way to override malloc.
I’m going to do some testing this morning to see if it resolves my memory corruption issues
from playdate-nim.
Related Issues (20)
- Build for device OS 2.0 error: undefined reference to `_fini' HOT 1
- Does not compile with Nim 2.0.0 HOT 8
- Runtime crashes halt simulator without any indication of problems HOT 6
- Feature: Basic Lua interop HOT 9
- Implement Std/random HOT 3
- api aliases HOT 2
- implement os module HOT 2
- LCD:Sprite.setImage crashes when invoked multiple times HOT 6
- Use `projectName()` instead of static PDX name? HOT 4
- Conflicting types HOT 4
- player volume: double promotion warning HOT 2
- Unclear naming requirement for main entrypoint nim file HOT 2
- arm-none-eabi-gcc: fatal error: cannot read spec file 'nosys.specs': No such file or directory HOT 3
- Any guidance on unit tests? HOT 1
- When importing std/logging, device compilation fails HOT 1
- Mac device Debug builds for device profiling HOT 1
- How to deal with "declared lock level is 0, but real lock level is <unknown> [LockLevel]" HOT 3
- Update the recommended VSCode Nim extension in the README HOT 1
- sigabrt: double free when calling file.close()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playdate-nim.