Closed raulpy271 closed 1 year ago
-cheerp-linear-heap-size=
defines the maximum size of the heap. The size is grown dynamically as required up to the provided size. The initial allocation will be as small as possible.
For further support consider joining our Discord: https://discord.gg/3UfTSbWdYy
I expected the argument
cheerp-linear-heap-size
to especify the initial heap size to give users control to define how much memory is allocated when starting execution. However, I tried to use the argument and the result was different from what I expected.For exemple, I created a simple "Hello World" program
test.c
, and compilled it withcheerp-linear-heap-size=100
:After it, I inserted the statement
console.log(__heap.byteLength);
inside the function_start
in thetest.js
file. This statement will print the initial size of the heap. The result is as fallows:The second line is the size of the heap, which is a little more than 1MB, I expected to be 100MB because I used
cheerp-linear-heap-size=100
. I want to understand why I got a different result and what does thecheerp-linear-heap-size
argument do.About my system:
Content of
test.c
: