Code Monkey home page Code Monkey logo

Comments (6)

samdze avatar samdze commented on June 7, 2024 1

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.

Nycto avatar Nycto commented on June 7, 2024

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.

samdze avatar samdze commented on June 7, 2024

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.

Nycto avatar Nycto commented on June 7, 2024

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.

Nycto avatar Nycto commented on June 7, 2024

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.

Nycto avatar Nycto commented on June 7, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.