GithubHelp home page GithubHelp logo

custom copy methods about aleph HOT 5 CLOSED

catfact avatar catfact commented on August 26, 2024
custom copy methods

from aleph.

Comments (5)

catfact avatar catfact commented on August 26, 2024

the memory stuff is weird because we have an SRAM that is not allocated from the heap. instead, the chip has a hard-coded address. there is a super-primitive system to allocate pointers to SRAM in avr32/src/memory.c , and no mechanism to free them. we could theoretically fix this by mapping the SRAM to heap in the memory map, but my abortive attempts at this were highly frustrating and wasted a lot of time.

anyways, my approach is to basically think of all of these data structures as statically allocated. memcpy should be fine and appropriate, except evidently some pointers to heap-allocated structures are sneaking in somewhere. probably a fucking string or maybe a function pointer. probably specific to the single extant momome grid operator.

from aleph.

catfact avatar catfact commented on August 26, 2024

still, might be safer to implement custom copy methods in the proper fashion.

from aleph.

catfact avatar catfact commented on August 26, 2024

belatedly realizing that of course certain things in this system will break between builds if operator layouts, etc change drastically.

obviously this is happening a lot right now. we could assume layouts will not change between major releases or something. i'm not really sure of the right way to handle version numbers but ship should be 0.x "beta" . can deal with compatibility when we want to break it ?

from aleph.

catfact avatar catfact commented on August 26, 2024

iss 49:

need deep-copy on ctlnet ?

case: scene is written with older version of bees
struct layouts for ops and everything are different.
loading the scene gives garbage.

so, scene file needs to store bees version number.
then we can knowingly break compatibility as long as we maintain inter-version translation routines.

obvs, would be safest to have deep-copy methods for everything,
even though this runs to a lot of code and is boring.
of course, have to do it sooner or later in order to have x-platform file parsing.

q: can struct layout ever change between builds because of optimization level or other non-coding reason? it would be nice to enforce packed everywhere, but having trouble with this when nesting structs with gcc.

from aleph.

catfact avatar catfact commented on August 26, 2024

using class-defined serialization methods, closing this and making #64

from aleph.

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.