Skip to content

Commit

Permalink
Mention an alternative approach for toolchains
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jun 6, 2024
1 parent da39cfc commit ba116d6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions proposals/custom-page-sizes/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,30 @@ This approach has the following benefits:

[imagine]: https://github.com/WebAssembly/custom-page-sizes/issues/3

#### Alternative: use an immutable global instead of the relocations

Alternativey, we can probably use an immutable global instead of
the relocations.

Pros over relocations:

- The toolchain implementations might be more straightforward that way.
- A global can be exported/imported. It might be simpler for things like
[dynamic-linking].
- The resulted binary might be more friendly to binary-rewriters like
wasm-opt.

A possible downside is that you can't have the page size in data sections.
Eg. consider a C global variable like the following.
It shouldn't be a big problem these days as modern applications do not
assume that the page size is a build-time constant anyway though.

```c
static int global_var = PAGE_SIZE;
```

[dynamic-linking]: https://github.com/WebAssembly/tool-conventions/blob/main/DynamicLinking.md

### How This Proposal Satisfies the Motivating Use Cases

1. Does this proposal help Wasm better target resource-constrained environments,
Expand Down

0 comments on commit ba116d6

Please sign in to comment.