Skip to content

Commit

Permalink
Allow generate_address_map config in Engine (#247)
Browse files Browse the repository at this point in the history
* allow generate address map config flag

* add yard comment

* Document `Wasmtime::Engine#generate_address_map`

---------

Co-authored-by: Ian Ker-Seymer <[email protected]>
  • Loading branch information
Maaarcocr and ianks authored Nov 29, 2023
1 parent 7584727 commit c3d5665
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ext/src/ruby_api/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ define_rb_intern!(
SPEED => "speed",
SPEED_AND_SIZE => "speed_and_size",
TARGET => "target",
GENERATE_ADDRESS_MAP => "generate_address_map",
AUTO => "auto",
CRANELIFT => "cranelift",
WINCH => "winch",
Expand Down Expand Up @@ -117,6 +118,8 @@ pub fn hash_to_config(hash: RHash) -> Result<Config, Error> {
Error::new(arg_error(), format!("Invalid target: {}: {}", target, e))
})?;
}
} else if *GENERATE_ADDRESS_MAP == id {
config.generate_address_map(entry.try_into()?);
} else {
return Err(Error::new(
arg_error(),
Expand Down
1 change: 1 addition & 0 deletions ext/src/ruby_api/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ impl Engine {
/// @option config [Boolean] :wasm_multi_memory
/// @option config [Boolean] :wasm_memory64
/// @option config [Boolean] :parallel_compilation (true) Whether compile WASM using multiple threads
/// @option config [Boolean] :generate_address_map Configures whether compiled artifacts will contain information to map native program addresses back to the original wasm module. This configuration option is `true` by default. Disabling this feature can result in considerably smaller serialized modules.
/// @option config [Symbol] :cranelift_opt_level One of +none+, +speed+, +speed_and_size+.
/// @option config [Symbol] :profiler One of +none+, +jitdump+, +vtune+.
/// @option config [Symbol] :strategy One of +auto+, +cranelift+, +winch+ (requires crate feature `winch` to be enabled)
Expand Down

0 comments on commit c3d5665

Please sign in to comment.