Hi @hopefuel!
That options set the maximum size of the wasm linear memory. The only difference in the binary produced is the corresponding value in the module declaration. Browsers will use this value when setting up the memory for the module. Tipically they will reserve some virtual memory equal to that amount, which should be free until actually used.
The memory allocator of cheerp will request to use more and more memory dinamically as needed, up until that limit.
So I would say that a larger than necessary value should not negatively affect your application, except maybe in 32 bits architectures (phones) when more than one wasm module is in the same tab process (since you could exaust the virtual memory).
cmake
, it still outputs a binary file instead of Javascript files. How do I make it output Javascript?
Hi @d4hines!
We provide a CMake toolchain file, so generally it is just a matter of calling cmake like this: cmake -DCMAKE_TOOLCHAIN_FILE=/opt/cheerp/share/cmake/Modules/CheerpToolchain.cmake <regular arguments>
I see that in the Makefile you are manually setting CC and CXX variables. You should probably unset them.
CompileError: wasm validation error: at offset 216400: type mismatch: expression has type i64 but expected i32
Do you have any ideas of what I should change? Thanks
Uncaught (in promise) CompileError: WebAssembly.instantiate(): Compiling function #522:"_ZN8nlohmann6detail10serializerINS_10basic_json..." failed: call[2] expected type i32, found i64.const of type i64 @+322391
Cheerp 1597723567-1~bionic clang version 7.0.0 (based on LLVM 7.0.0svn). I understand that int64_t is used but only int32_t is supported. Shouldn't this appear when compiling as an error?
/opt/cheerp/bin/../include/c++/v1/fstream:579:17: error: use of undeclared identifier 'fdopen'; did you mean 'fopen'?
__file_ = fdopen(__fd, __mdstr);
^
/opt/cheerp/bin/../include/c++/v1/cstdio:145:9: note: 'fopen' declared here
using ::fopen;
^
/opt/cheerp/bin/../include/c++/v1/fstream:579:24: error: cannot initialize a parameter of type 'const char *' with an lvalue of type 'int'
__file_ = fdopen(__fd, __mdstr);
Hello, I am trying to use the cheerp file system, as soon as I add in my test file:
cheerp::FilePreloader files(preloadCallback, "CemHyds-dat.lst", "CemHyds-dbr.lst",
"CemHyds-dch.dat", "CemHyds-imp.dat", "CemHyds-dbr-0-0000.dat", "logfile.txt");
I get this error in the browser:
Uncaught (in promise) Error: this should be unreachable
__dummy http://127.0.0.1:8080/gemsw.js:57
promise http://127.0.0.1:8080/gemsw.js:78
promise callback* http://127.0.0.1:8080/gemsw.js:69