modus
Menu
On this page

The entry arena

The test of an arena paid by the budget.

The process reserves an arena a little larger than its whole budget, and pushes one page at a time until the budget refuses a commit. Then it checks:

  • the refusal is the status No_Budget with its error record, and the process still runs;
  • the refused push changed nothing in the arena, and the budget holds no page;
  • each page that a push gave read zero before its first write;
  • after a reset, the same pushes give the same addresses and commit nothing;
  • after the end of the arena, the budget holds again each page that it held before the reservation.

What it is for. It proves on a machine that a process can hold data with no known bound and read a lack of memory as a value: the arena grows by an explicit commit, the kernel refuses the commit that the budget cannot pay, and the end of the arena returns every page at once.

Start: start("arena") in the console. It needs no grant: an arena is memory of its own budget.

What a reader sees: no window. The log has one line of counts, "arena: grew to ... pages in ... commits ...", then "arena: the budget refused the commit with No_Budget, the arena kept its state, a reset took the same pages again with no commit, and its end gave every page back to the budget: as it must", or a line "arena: WRONG: ...". The process stops with Done, or with Failed after a WRONG line.

See: Memory without a bound: arenas paid by the budget in the repository

arena module with an entry

Hash
0d97bfaca64bef291c7616239bced7a7226b3445fa0c948518db8ef0d06cf771
Size
40960 bytes
Exports
0
Imports
0
Imported by
0
License
MIT

The test of an arena paid by the budget

FactValue
KindModules with an entry
Sourcesrc/modules/tests/arena
Boot imageyes: in the boot image, 40960 bytes in this build
Build settingsnone: the defaults of the source
Importsnone
Imported bynone

Neighbours

It imports no module, and no module imports it. The module graph shows it with the other modules that have no edge.

Exports

ExportWhat it does
entry()runs the test, writes its result on the log, and stops

entry

entry()

entry runs the test, writes its result on the log, and stops.

Form
The entry of the module: one parameter, an address, fixed by the contract.
Source
src/modules/tests/arena/main.odin:41

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

WhatValueAs the root service says
GrantsnoneAn arena that grows until its own budget refuses a commit.
Other terms of its start grant setnone
Budget that it asks for
  • the least budget
No MODULE_BUDGET in its source: it asks for the least budget.

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; 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).