I think I was unclear, I mean that I trying to access HEAP variables from
outside of Module.
Anyway I have a test case. It instantiate simple wasm module and print all
Module keys that started from HEAP.
It prints them both from inside Module and from outside. "inside" case
works all times, but "outside" case works only until 2.0.10.
Need to run `./test.sh`

https://drive.google.com/file/d/1Yudusi2wQsWqG4ItAaFEx4hsAbY92WLe/view?usp=sharing

Output for 2.0.9:
```
+ rm -rf ./build
+ mkdir ./build
+ em++ v1.cpp -s INVOKE_RUN=0 -s WASM=1 -s MODULARIZE=1 -s SAFE_HEAP=0 -s
ASSERTIONS=1 -s 'EXPORTED_FUNCTIONS=["_main","_malloc","_free"]' -O0
--emit-symbol-map -o build/v1.js
+ node v1-test.js
== FROM OUTSIDE ==
HEAP8
HEAP16
HEAP32
HEAPU8
HEAPU16
HEAPU32
HEAPF32
HEAPF64
== FROM INSIDE ==
HEAP8
HEAP16
HEAP32
HEAPU8
HEAPU16
HEAPU32
HEAPF32
HEAPF64
```

Output for 2.0.10+:
```
+ rm -rf ./build
+ mkdir ./build
+ em++ v1.cpp -s INVOKE_RUN=0 -s WASM=1 -s MODULARIZE=1 -s SAFE_HEAP=0 -s
ASSERTIONS=1 -s 'EXPORTED_FUNCTIONS=["_main","_malloc","_free"]' -O0
--emit-symbol-map -o build/v1.js
+ node v1-test.js
== FROM OUTSIDE ==
== FROM INSIDE ==
HEAP8
HEAP16
HEAP32
HEAPU8
HEAPU16
HEAPU32
HEAPF32
HEAPF64
```

ср, 17 февр. 2021 г. в 00:27, Alon Zakai <[email protected]>:

> (I think this is separate from minification. We minify wasm imports and
> exports, but the HEAP* views are handled entirely in JS.)
>
> On Tue, Feb 16, 2021 at 9:06 AM Floh <[email protected]> wrote:
>
>> Just a wild guess: maybe the name has been mangled by the minification
>> pass, while in previous emscripten versions it might have been "protected"
>> from minification?
>>
>> I've seen similar problem in the past where Module.func_name() stopped
>> working in newer emscripten versions (especially with stuff like ccall
>>
>> FWIW I'm using HEAP* as global variable (not Module.HEAP*) and that still
>> seems to work, for instance:
>>
>>
>> https://github.com/floooh/sokol/blob/c8023ab515822005d74c36b3a77656315a5ce1be/sokol_audio.h#L1493-L1498
>>
>> Cheers,
>> -Floh.
>> On Tuesday, 16 February 2021 at 10:20:53 UTC+1 caiiiycuk wrote:
>>
>>> Hi. I faced issue that my js code stop working from 2.0.10. It uses
>>> Module.HEAP* variables to access wasm memory. However from 2.0.10 Module
>>> does not contains this variables anymore. Is it expected behavior, how I
>>> can reexport them?
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "emscripten-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/emscripten-discuss/ef21bd22-4ed4-440c-b573-bc1186468daan%40googlegroups.com
>> <https://groups.google.com/d/msgid/emscripten-discuss/ef21bd22-4ed4-440c-b573-bc1186468daan%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpRodoU9gK_oTU2yUiga_7f4FtVO%3DzZSbGzXZufZ5sRFhA%40mail.gmail.com
> <https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpRodoU9gK_oTU2yUiga_7f4FtVO%3DzZSbGzXZufZ5sRFhA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAKOm%3DVGfsUdji1Zx5UpKrLR0gbwqD3L3fOLTycnCVCGTOQfahw%40mail.gmail.com.

Reply via email to