Comments (5)
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.
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.
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.
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.
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)
- RFC: Re-loadable plugin callbacks and nested plugins. HOT 23
- Print errors outside of debug mode HOT 1
- Unable to rollback crash in first load of plugin HOT 8
- [Feature] Call any Function
- [Tutorial]Windows *.dll only Live Reload
- clang compile warnings HOT 1
- clang compile warning (trivial) HOT 1
- cr_main isn't invoked with operation CR_LOAD and the context passed to cr_plugin_load HOT 18
- Unknown pragmas
- Improve CI and range of compilers to test
- cr_pdb_process has unused arguments HOT 3
- multiple definition issue HOT 1
- Can't load plugins on linux HOT 2
- CR_LOAD called on first update, contrary to what the documentation states. Is this correct? HOT 2
- Crash protection prevents host crashes, causing application to freeze HOT 2
- AddressSanitizer reports an error when calling cr_plugin_close HOT 2
- Assert protection? HOT 10
- How to use this with Visual Studio? HOT 4
- Unable to build samples on Linux "Cannot specify link libraries for target "crTest" which is not built by this project" HOT 2
- Whilst using cmake's FetchContent_MakeAvailable, there's no way to disable FIPS. HOT 1
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 cr.