MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / test_many_parameters

Function test_many_parameters

tests/all/component_model/func.rs:837–1100  ·  view source on GitHub ↗
(dynamic: bool, concurrent: bool)

Source from the content-addressed store, hash-verified

835}
836
837async fn test_many_parameters(dynamic: bool, concurrent: bool) -> Result<()> {
838 let (body, async_opts) = if concurrent {
839 (
840 r#"
841 (call $task-return
842 (i32.const 0)
843 (i32.mul
844 (memory.size)
845 (i32.const 65536)
846 )
847 (local.get 0)
848 )
849
850 (i32.const 0)
851 "#,
852 r#"async (callback (func $i "callback"))"#,
853 )
854 } else {
855 (
856 r#"
857 (local $base i32)
858
859 ;; Allocate space for the return
860 (local.set $base
861 (call $realloc
862 (i32.const 0)
863 (i32.const 0)
864 (i32.const 4)
865 (i32.const 12)))
866
867 ;; Store the pointer/length of the entire linear memory
868 ;; so we have access to everything.
869 (i32.store offset=0
870 (local.get $base)
871 (i32.const 0))
872 (i32.store offset=4
873 (local.get $base)
874 (i32.mul
875 (memory.size)
876 (i32.const 65536)))
877
878 ;; And also store our pointer parameter
879 (i32.store offset=8
880 (local.get $base)
881 (local.get 0))
882
883 (local.get $base)
884 "#,
885 "",
886 )
887 };
888
889 let component = format!(
890 r#"(component
891 (core module $libc
892 (memory (export "memory") 1)
893
894 {REALLOC_AND_FREE}

Callers 4

many_parametersFunction · 0.85
many_parameters_dynamicFunction · 0.85

Calls 15

OkFunction · 0.85
run_concurrentMethod · 0.80
call_concurrentMethod · 0.80
collectMethod · 0.80
ptr_lenMethod · 0.80
newFunction · 0.50
instantiate_asyncMethod · 0.45
as_sliceMethod · 0.45
unwrapMethod · 0.45
get_funcMethod · 0.45
call_asyncMethod · 0.45

Tested by

no test coverage detected