Closed yamt closed 3 months ago
Six of one, half a dozen of another. Both approaches should enable const-folding/-propagation and avoids accessing memory, which tends to inhibit compiler optimization.
if there is little differences, i guess it's simpler to use a global instead.
I would say "simpler" is a matter of opinion. I personally find an i32.const
to be "simpler" but it looks like wasm-ld
will probably use a global instead. Again either way works fine.
Happy to accept a PR to the overview clarifying that either an i32.const
or a global and global.get
would satisfy the constraints, if you want to make one.
This was addressed in #22.
the overview states it's ideal to use a relocation for page size. why do you prefer a relocation over eg. an immutable global?