Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced Orthogonal Persistence: Use Passive Data Segments (32-Bit) #4410

Merged
merged 11 commits into from
Feb 22, 2024

Conversation

luc-blaeser
Copy link
Contributor

@luc-blaeser luc-blaeser commented Feb 22, 2024

Enhanced Orthogonal Persistence: Use Passive Data Segments (32-Bit)

Only passive Wasm data segments are used by the compiler and runtime system. In contrast to ordinary active data segments, passive segments can be explicitly loaded to a dynamic address.

This simplifies two aspects:

  • The generated Motoko code can contain arbitrarily large data segments which can loaded to dynamic heap when needed.
  • The IC can simply retain the main memory on an upgrade without needing to patch the active data segments of the new program version to the persistent memory.

However, more specific handling is required for the Rust-implemented runtime system:
The Rust-generated active data segments of the runtime system is changed to passive and loaded to the expected static address at the program start (canister initialization and upgrade).
The location and size of the RTS data segments is therefore limited to a defined reserve, see above.
This is acceptable because the RTS only uses small size for data segments (e.g. 54KB) that is independent of the compiled Motoko program.

@luc-blaeser luc-blaeser self-assigned this Feb 22, 2024
@luc-blaeser luc-blaeser changed the title Enhanced Orthogonal Persistence: Use Passive Data Segments Enhanced Orthogonal Persistence: Use Passive Data Segments (32-Bit) Feb 22, 2024
Copy link

Comparing from be54eca to 0b857fc:
The produced WebAssembly code seems to be completely unchanged.

@luc-blaeser luc-blaeser marked this pull request as ready for review February 22, 2024 16:30
@luc-blaeser luc-blaeser merged commit 1e83095 into luc/stable-heap Feb 22, 2024
6 checks passed
@luc-blaeser luc-blaeser deleted the luc/stable-heap-passive-data-segments branch February 22, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant