Skip to content

Commit

Permalink
Enhance memory management and debugging in WazeroRuntime
Browse files Browse the repository at this point in the history
- Introduced new helper functions for memory allocation and reading in `wazeroruntime.go`, improving safety and efficiency.
- Added a maximum memory pages constant to centralize memory configuration.
- Refactored `callContractFn` to streamline memory operations and enhance debug logging for better traceability during contract execution.
- Implemented region-based approaches for writing environment, message, and info data, ensuring robust memory handling.
- Improved error handling and validation for memory operations, enhancing overall reliability.
  • Loading branch information
faddat committed Jan 6, 2025
1 parent 58af4fd commit 385cdb5
Show file tree
Hide file tree
Showing 2 changed files with 252 additions and 212 deletions.
1 change: 1 addition & 0 deletions internal/runtime/hostfunctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,7 @@ func RegisterHostFunctions(runtime wazero.Runtime, env *RuntimeEnvironment) (waz
WithResultNames("key_ptr").
Export("db_next_key")

// Compile and return the module
return builder.Compile(context.Background())
}

Expand Down
Loading

0 comments on commit 385cdb5

Please sign in to comment.