diff options
| author | Luuk de Gram <luuk@degram.dev> | 2024-01-10 06:35:50 +0100 |
|---|---|---|
| committer | Luuk de Gram <luuk@degram.dev> | 2024-01-12 14:57:36 +0100 |
| commit | 7fe629a8124f27e8db01e090031a5243a452e831 (patch) | |
| tree | b9bb349520685f9b972a789a49f72ddd719464ad /lib/std/bounded_array.zig | |
| parent | 2b3e6f680c5843877f6252bd3d85a20abe367da6 (diff) | |
| download | zig-7fe629a8124f27e8db01e090031a5243a452e831.tar.gz zig-7fe629a8124f27e8db01e090031a5243a452e831.zip | |
wasm-linker: delay code atom allocation till write
We delay atom allocation for the code section until we write the actual
atoms. We do this to ensure the offset of the atom also includes the
'size' field which is leb128-encoded and therefore variable. We need this
correct offset to ensure debug info works correctly.
The ordering of the code section is now automatic due to iterating the
function section and then finding the corresponding atom to each
function. This also ensures each function corresponds to the right atom,
and they do not go out-of-sync.
Lastly, we removed the `next` field as it is no longer required and also
removed manually setting the offset in synthetic functions. This means
atoms use less memory and synthetic functions are less prone. They will
also be placed in order of function order correctly.
Diffstat (limited to 'lib/std/bounded_array.zig')
0 files changed, 0 insertions, 0 deletions
