Expand description
The load module (.iwm) of docs/load-module.md: its container, encoding rules and codec, and
the modules a run loads programs from.
Modules§
- codec
- The codec traits, the writer and reader they use, the §4.1 and §4.4 impls, and the §4.6 macros.
- crc
- CRC-32: the IEEE polynomial, reflected, initial and final XOR
0xFFFFFFFF(load-module.md §3.3). - leb
- Unsigned LEB128 and zigzag (load-module.md §4.1), with only the canonical form accepted.
Structs§
- Directory
Entry - A program’s line in the
DIRECTORYsection (load-module.md §6). - LirRecord
- One program’s record in the
LIRsection: the fields ofProgramno other section holds. - Loaded
Module - The programs of a module, in ordinal order, with their directory and the mapsets they use.
- Module
- A module whose header and table are checked; a section’s checksum is checked when it is read.
- Module
Writer - Builds section bodies in id order;
finishputs the string table first and adds the checksums. - Modules
- Reader
- A bounds-checked cursor over one section’s bytes.
- Section
- A section this version knows (load-module.md §3.4). Every one is required.
- Section
Entry - String
Table - The one table of strings a module’s sections refer to by index (load-module.md §4.2).
- Version
- Writer
- Section bytes being built, and the string table they intern into.
Enums§
Constants§
- EXTENSIONS
- The first id of the extension sections, which are always written optional.
- MAGIC
- OPTIONAL
- Flag bit 0 of a section entry: a reader that does not know the section skips it.
Traits§
Functions§
- member_
name - Whether
namecan name a library member; any other name never reaches the filesystem. - read
- Reads and checks a module; the bytes of every section are checksummed.
- write
- A module of
programs, each a top-level program in the directory, with no mapsets. Same input, same bytes. - write_
with - A module with the caller’s directory and mapsets, refused (as the reader would) if either, or a program, is invalid.
Type Aliases§
- Check
- What a program from a module must pass before the VM runs it, since a module is untrusted input.
- Layout
Record - One program’s record in the
LAYOUTsection.