Git Product home page Git Product logo

Comments (5)

fungos avatar fungos commented on August 16, 2024

You can try this update? Otherwise, I couldn't get your lib to work, so you may want to do some logging/printf on cr_elf_section_save.
Another thing, you may try to change the state saving mode by defining your CR_HOST as CR_DISABLE or CR_SAFEST just to be sure everything else is working correctly with Urhol3D.

from cr.

rokups avatar rokups commented on August 16, 2024

Hey thank you for quick fix, that did the trick! And it works with default behaviour now (defining CR_HOST to empty value).

Since there is no other place to ask please allow me to voice few (offtopic to this bug) questions regarding cr :) I do know that scope of safe changes is limited, however i am still trying to gauge that scope. I know that changing data structures is unsafe, but i suspect that code changes are unsafe as well. Say i modify some code in a method, add a good chunk of logic. It has a potential to shift addresses of methods that come after. So if any of these methods are virtual then objects created by reloadable module would no longer contain valid entries in virtual method table, right? I consulted with someone else and they said the only sensible approach is to serialize state on unload and unserialize state on load. Is that really the case and no workarounds available?

from cr.

fungos avatar fungos commented on August 16, 2024

Unfortunately that is the case. With cr.h you can manually manage this when receiving CR_UNLOAD. But C++ is a complex beast and a lot can go wrong anyway. If you do really want automatic and safe C++ support, you're better of with the excellent RCCPP. It is a bit more complex than cr.h, but it does complex things due C++ being complex. :)

from cr.

rokups avatar rokups commented on August 16, 2024

I am experimenting with using cr.h for injecting user components to 3d scene editor. At least for this usecase serializing/deserializing things looks acceptable to me. Since you know a great deal on this topic could you please elaborate on what exactly RCCPP does what cr.h does not? Knowing details will help me to avoid shooting myself in the foot eventually ;)

Edit: actually i think i found all the answers: http://www.gameaipro.com/GameAIPro/GameAIPro_Chapter15_Runtime_Compiled_C++_for_Rapid_AI_Development.pdf
Thanks again :)

from cr.

fungos avatar fungos commented on August 16, 2024

Yup, all the answers are there! You can see really well how rccpp and cr differs there as cr is a really simple and dumb solution but good enough to get the basics of hot-reloading working.

from cr.

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.