The entry interface_through_module
The interface package as a module, for one process: one frame built in two ways, compared. The design: The interface of the processes: Where it lives: the elements in each process, the drawing in a module. This process builds the same frame in two ways: through the exports of the module interface_module, which it imports (each call passes the draw table and the text table of this process as table parameters, with no copy), and with the package src/library/modus/interface compiled in. It compares the two draw tables and measures the two builds. It draws its window through the drawing module, which it imports too: the damage by difference and the draw of the records into its pixels are the two exports of that module. Then it draws one frame two times, with the package compiled in and through the drawing module, into two canvases of its own, and compares their bytes: the package draws with the text settings that this process loaded, the module with those that the module loaded.
What it is for. It shows that one code module can be a library in another process with no loss: the interface package as the module interface_module gives the same draw table as the package compiled in, and a table parameter passes the tables of the caller with no copy. The measures give the cost of a call through an import.
What a reader sees. Start it from the start menu, or with start("interface_through_module") in the console. The window is drawn through the module. The log gets the times of the two builds, the time of the damage and the drawing through the module and the size of its code, the case of a draw table of 16 places that is too small, then interface_through_module: ok, the two draw tables are equal, or wrong: the two draw tables differ, then the line of the two canvases, which ends with the same bytes: as it must.
Its grant: Image: it reads the size of the code of interface_module in the boot image.
interface_through_module module with an entry
- Hash
24ee73ab7180306bb9b84cd30f89586b5b4339d20c3d410bf480a7a18e33c6a5- Size
194795 bytes- Exports
0- Imports
2- Imported by
0- License
- MIT
The interface package as a module, for one process: one frame built in two ways, compared
| Fact | Value |
|---|---|
| Kind | Modules with an entry |
| Source | src/modules/demonstrations/interface_through_module |
| Boot image | yes: in the boot image, 194795 bytes in this build |
| Build settings | none: the defaults of the source |
| Imports | |
| Imported by | none |
Neighbours
What it imports, at its left, and what imports it, at its right: the part of the module graph that touches it.
Exports
| Export | What it does |
|---|---|
entry() | builds the frame through the module and with the package, compares the two draw tables, measures both builds and the case of a table that is too small, writes the lines on the log, then draws its window through the module at each event until the process is stopped |
entry
entry()
entry builds the frame through the module and with the package, compares the two draw tables, measures both builds and the case of a table that is too small, writes the lines on the log, then draws its window through the module at each event until the process is stopped. With no window, it stops with Failed.
- Form
- The entry of the module: one parameter, an address, fixed by the contract.
src/modules/demonstrations/interface_through_module/main.odin:413
Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).
What the root service gives it
| What | Value | As the root service says |
|---|---|---|
| Grants | It reads the size of the code of interface_module. | |
| Other terms of its start grant set | none | |
| Budget that it asks for |
| The least budget of 2048 pages, in which it ran before it stated its window, less that window at the scale 1 (536 pages): its module, its stack, its tables and its glyph memory. The tool counts the window at the largest scale. See: Module contract: The budget that a module asks for |
The start grant set is read from start_grant_sets in src/modules/system/root/start_grant_sets.odin. The stated budget is read from the constant MODULE_BUDGET of the source of the module (its line); the build adds the counted parts and writes the sum in the module (tools/modustool/build/budget_count.odin); the root service accepts it up to the largest budget of a process, and adds the limits of processor time and of log records (src/modules/system/root/budgets.odin).
