-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Part of #69
Task
For each re-exporter component (identified via graph.reexporter_components), allocate a region in its linear memory for a handle table.
Implementation
Files: meld-core/src/merger.rs
- Add
HandleTableInfostruct:
pub struct HandleTableInfo {
pub memory_idx: u32,
pub next_ptr_global: u32,
pub table_base_addr: u32,
pub capacity: u32,
}-
Add
pub handle_tables: HashMap<usize, HandleTableInfo>toMergedModule -
After merging all components, for each re-exporter:
- Find memory index from
memory_index_map[(comp_idx, 0, 0)] - Scan data segments to find highest
offset + data.len()for that memory - Round up to 4-byte alignment →
table_base_addr - Add mutable i32 global initialized to
table_base_addr + 4(skip slot 0) - Ensure memory has enough pages for table (256 entries = 1024 bytes)
- Find memory index from
Branch
feat/per-component-handle-tables
Acceptance
cargo test --package meld-core passes (73 tests, no regression).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels