pub fn for_memory(memory: Memory, tunables: &Tunables) -> (Self, u64) {
        if let Some(maximum) = memory.maximum {
            if maximum <= tunables.static_memory_bound {
                // A heap with a declared maximum can be immovable, so make
                // it static.
                assert_ge!(tunables.static_memory_bound, memory.minimum);
                return (
                    Self::Static {
                        bound: tunables.static_memory_bound,
                    },
                    tunables.static_memory_offset_guard_size,
                );
            }
        }

        // Otherwise, make it dynamic.
        (Self::Dynamic, tunables.dynamic_memory_offset_guard_size)
    }
/// Decide on an implementation style for the given `Memory`.
Decide on an implementation style for the given `Memory`.
Decide on an implementation style for the given ` Memory ` .
pub fn for_memory(memory: Memory, tunables: &Tunables) -> (Self, u64) {
        if let Some(maximum) = memory.maximum {
            if maximum <= tunables.static_memory_bound {
                // A heap with a declared maximum can be immovable, so make
                // it static.
                assert_ge!(tunables.static_memory_bound, memory.minimum);
                return (
                    Self::Static {
                        bound: tunables.static_memory_bound,
                    },
                    tunables.static_memory_offset_guard_size,
                );
            }
        }
        // Otherwise, make it dynamic.
        (Self::Dynamic, tunables.dynamic_memory_offset_guard_size)
    }
pub fn for_memory ( memory : Memory , tunables : & Tunables ) -> ( Self , u64 ) { if let Some ( maximum ) = memory . maximum { if maximum <= tunables . static_memory_bound { // A heap with a declared maximum can be immovable, so make // it static. assert_ge ! ( tunables static_memory_bound memory minimum ) ; return ( Self :: Static { bound : tunables . static_memory_bound , } , tunables . static_memory_offset_guard_size , ) ; } } // Otherwise, make it dynamic. ( Self :: Dynamic , tunables . dynamic_memory_offset_guard_size ) }
Decide on an implementation style for the given `Memory`.
Decide on an implementation style for the given ` Memory ` .
memory
Memory
tunables
&Tunables
memory
Memory
tunables
&Tunables