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

Cut down on serde requirements in wasmtime crate #10129

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/cli-flags/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ wasmtime_option_group! {

/// Enable memory protection keys for the pooling allocator; this can
/// optimize the size of memory slots.
#[serde(default)]
#[serde(deserialize_with = "crate::opt::cli_parse_wrapper")]
pub pooling_memory_protection_keys: Option<wasmtime::MpkEnabled>,

/// Sets an upper limit on how many memory protection keys (MPK) Wasmtime
Expand Down
11 changes: 5 additions & 6 deletions crates/wasmtime/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use alloc::sync::Arc;
use bitflags::Flags;
use core::fmt;
use core::str::FromStr;
use serde_derive::{Deserialize, Serialize};
#[cfg(any(feature = "cache", feature = "cranelift", feature = "winch"))]
use std::path::Path;
use wasmparser::WasmFeatures;
Expand Down Expand Up @@ -2607,7 +2606,7 @@ impl fmt::Debug for Config {
///
/// This is used as an argument to the [`Config::strategy`] method.
#[non_exhaustive]
#[derive(PartialEq, Eq, Clone, Debug, Copy, Deserialize)]
#[derive(PartialEq, Eq, Clone, Debug, Copy)]
pub enum Strategy {
/// An indicator that the compilation strategy should be automatically
/// selected.
Expand Down Expand Up @@ -2677,7 +2676,7 @@ impl Strategy {
/// additional objects. Reference counts are larger than mark bits and
/// free lists are larger than bump pointers, for example.
#[non_exhaustive]
#[derive(PartialEq, Eq, Clone, Debug, Copy, Deserialize)]
#[derive(PartialEq, Eq, Clone, Debug, Copy)]
pub enum Collector {
/// An indicator that the garbage collector should be automatically
/// selected.
Expand Down Expand Up @@ -2777,7 +2776,7 @@ impl Collector {

/// Possible optimization levels for the Cranelift codegen backend.
#[non_exhaustive]
#[derive(Copy, Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum OptLevel {
/// No optimizations performed, minimizes compilation time by disabling most
/// optimizations.
Expand All @@ -2791,7 +2790,7 @@ pub enum OptLevel {

/// Possible register allocator algorithms for the Cranelift codegen backend.
#[non_exhaustive]
#[derive(Copy, Clone, Debug, Serialize, Deserialize, Eq, PartialEq)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum RegallocAlgorithm {
/// Generates the fastest possible code, but may take longer.
///
Expand Down Expand Up @@ -2851,7 +2850,7 @@ pub enum WasmBacktraceDetails {
}

/// Describe the tri-state configuration of memory protection keys (MPK).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Deserialize)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum MpkEnabled {
/// Use MPK if supported by the current system; fall back to guard regions
/// otherwise.
Expand Down
Loading