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, the mapsets they use, and for each program the file each source of its debug table names, None where the compiler supplied the member or no file was recorded.
- 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 - Source
File - A file the compile read, as the run journal of a run of its source names it (load-module.md
§9.2): the library it was found in, 0 the source’s own directory and then each
-Iin order, its path from there, and its SHA-256 and length. - 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 and no files recorded. Same input, same bytes. - write_
module - The module
moduledescribes, refused (as the reader would) if its directory, mapsets, a program or a program’s files are invalid. - write_
with - A module with the caller’s directory and mapsets and no files recorded, 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.