Comments (4)
Hmm... I haven't worked with side modules yet, but I don't believe they have their own address space, that would isolate them completely from the main module and other side modules. As far as I can see from the documentation the difference is that they are 'pure code', without attached runtime (I guess they access the shared runtime from the main module)
I suspect instead that something's wrong about the allocation of the static char _type_id;
here when running in the context of a side module:
oryol/code/Modules/Core/Class.h
Line 37 in ad2fc30
Maybe the side module's static "allocation counter" is running independent from the main module (and other side modules), so that statics setup in the main and side modules end up in the same memory location.
from oryol.
PS: also googling for smth like "emscripten side module static initialization" brings up this fairly recent bug:
emscripten-core/emscripten#6991
Is your emscripten version uptodate?
from oryol.
Yeah - locally I build with the incoming
branch as per fips's default, and I have a script for Travis that patches fips to use 1.38.12, which is already after the bug was fixed (definitely fixed before 1.38.11 according to that).
from oryol.
One (unpleasant) option is an alternative system for Emscripten: global symbols are clearly visible from side modules - I use ImGui built into my main module from my plugins - so we could set a global int - a 32-bit number should be plenty (even if it's an extra 3 bytes per class), and have each class declare a static int that's initialized to the global from the main module ++
on startup. That quadruples the size of the RTTI, but should (if implemented properly) work as a temporary hack until this bug is fixed in Emscripten.
from oryol.
Related Issues (20)
- Emscripten file loading HOT 4
- Map initialization through initializer_list HOT 1
- RTTI documentation HOT 2
- Android build failure HOT 4
- Not compiling on macOS10.14.1 (recent update) HOT 7
- Versioning and releases
- fips build error - macOS 10.13 HOT 1
- Input broken under emscripten HOT 3
- Dequeue error when adding lots of DrawStates HOT 1
- Game controllers detected twice on Linux when both evdev and legacy joystick API are available HOT 1
- cling based C++ as scripting language / hot code reload
- Error when running fips webpage build [Windows 10] HOT 1
- WebGL code path needs fixing.
- Question: How z buffer range considered with different graphic API? HOT 1
- Field of illegal type 'float [1]' when compiling for OSX+Metal HOT 2
- HttpFS on Windows sends gzip/deflate accept header, but doesn't decompress resulting data HOT 1
- Broken canvasX/canvasY values inside emscInputMgr::emscMouseMove callback
- Cmake: can't open file 'F:/Dropbox/Tech/production/ppc/oryol/cmake-build-release/fips-gen.py': HOT 2
- Adding a new CMake dependency without using 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 oryol.