The program tables
Tables and bytes as parameters (docs/MODULE_CONTRACT.md, "Tables and bytes as parameters"): one description, three ways to call.
This program calls the exports of the module sample with tables in its own memory, in three ways, with the same arguments: a direct call of the module that it loaded in its own address space, an isolated call of a call host that it starts, and an isolated call of the service "sample" (the same module, started by the root service as a program). It shows each answer, the hostile cases, and the cost of each way for tables of 64, 1024 and 65536 records of 40 bytes.
| Fact | Value |
|---|---|
| Source | programs/tables |
| Boot image | in the boot image; the image is not built, so its size is not known |
| Imports | none |
| Imported by | none |
Exports
| Export | What it does |
|---|---|
| entry() |
Read from the source of the module, as the build reads it to describe the exports (tools/kerneltool/describe.odin).
What the root service gives it
| What | Value | As the root service says |
|---|---|---|
| Grants | {.Image, .Connect} | It loads sample, starts a call host of it from the boot image, and connects to the service sample (docs/MODULE_CONTRACT.md, "Tables and bytes as parameters"). |
| Budget: pages, programs, threads | {pages = 4096, programs = 3, threads = 3} | A table of 65536 readings in a memory object (640 pages), and two call hosts (sample, hostile_exports) with their threads. |
Read from grants_of and things_of in programs/root/main.odin; budget_of in the same file adds the limits of processor time and of log records.
