Skip to content

fix: make map types public#1313

Merged
simongdavies merged 1 commit intohyperlight-dev:mainfrom
simongdavies:fix-map-file-cow
Mar 17, 2026
Merged

fix: make map types public#1313
simongdavies merged 1 commit intohyperlight-dev:mainfrom
simongdavies:fix-map-file-cow

Conversation

@simongdavies
Copy link
Contributor

This pull request fixes visibility in the memory region handling code in src/hyperlight_host/src/mem/memory_region.rs for hyperlight-wasm use.

Visibility improvements:

  • Made the MemoryRegionType enum public, allowing it to be used outside of the current crate.
  • Made the SurrogateMapping enum public, so it can be accessed from other modules or crates.
  • Made the surrogate_mapping method on MemoryRegionType public, enabling external code to determine the surrogate mapping for a given memory region type.

@jsturtevant
Copy link
Contributor

Need to make the field on MemoryRegion pub as well:

      let rgn = MemoryRegion {
    |                   ------------ in this type
...
127 |             region_type: MemoryRegionType::Heap,
    |             ^^^^^^^^^^^ private field

Maybe a integration test that uses map_region would be a good addtion? I should have done this when we ran into it before #1293

@jsturtevant
Copy link
Contributor

verified the latest changes work in HL-wasm

@simongdavies simongdavies changed the title map types public fix: make map types public Mar 16, 2026
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
@simongdavies simongdavies merged commit 564d0cc into hyperlight-dev:main Mar 17, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bugfix For PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants