From 4f01711d42906c34ae566f0d8eaafd824b711587 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Tue, 8 Feb 2022 10:29:45 -0800 Subject: [PATCH] Pooling allocator: Default for allocation policy should use memfd feature, not memfd-allocator. (#3777) Thanks to @peterheune for noticing this! --- crates/runtime/src/instance/allocator/pooling.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crates/runtime/src/instance/allocator/pooling.rs b/crates/runtime/src/instance/allocator/pooling.rs index bab7a47f3f..46d96ecfa9 100644 --- a/crates/runtime/src/instance/allocator/pooling.rs +++ b/crates/runtime/src/instance/allocator/pooling.rs @@ -259,14 +259,12 @@ pub enum PoolingAllocationStrategy { } impl Default for PoolingAllocationStrategy { - #[cfg(feature = "memfd-allocator")] fn default() -> Self { - Self::ReuseAffinity - } - - #[cfg(not(feature = "memfd-allocator"))] - fn default() -> Self { - Self::NextAvailable + if cfg!(memfd) { + Self::ReuseAffinity + } else { + Self::NextAvailable + } } }