@@ -1804,9 +1804,11 @@ wasm_runtime_wasi_nn_graph_registry_args_set_defaults(WASINNRegistry *args)
18041804
18051805bool
18061806wasm_runtime_wasi_nn_registry_set_args (WASINNRegistry * registry ,
1807- const char * * model_names , const uint32_t * * encoding ,
1808- const uint32_t * * target , uint32_t n_graphs ,
1809- const char * * graph_paths )
1807+ const char * * model_names ,
1808+ const uint32_t * * encoding ,
1809+ const uint32_t * * target ,
1810+ uint32_t n_graphs ,
1811+ const char * * graph_paths )
18101812{
18111813 if (!registry || !model_names || !encoding || !target || !graph_paths ) {
18121814 return false;
@@ -1818,11 +1820,16 @@ wasm_runtime_wasi_nn_registry_set_args(WASINNRegistry *registry,
18181820 }
18191821
18201822 registry -> n_graphs = n_graphs ;
1821- registry -> target = (uint32_t * * )wasm_runtime_malloc (sizeof (uint32_t * ) * n_graphs );
1822- registry -> encoding = (uint32_t * * )wasm_runtime_malloc (sizeof (uint32_t * ) * n_graphs );
1823- registry -> loaded = (uint32_t * * )wasm_runtime_malloc (sizeof (uint32_t * ) * n_graphs );
1824- registry -> model_names = (uint32_t * * )wasm_runtime_malloc (sizeof (uint32_t * ) * n_graphs );
1825- registry -> graph_paths = (uint32_t * * )wasm_runtime_malloc (sizeof (uint32_t * ) * n_graphs );
1823+ registry -> target =
1824+ (uint32_t * * )wasm_runtime_malloc (sizeof (uint32_t * ) * n_graphs );
1825+ registry -> encoding =
1826+ (uint32_t * * )wasm_runtime_malloc (sizeof (uint32_t * ) * n_graphs );
1827+ registry -> loaded =
1828+ (uint32_t * * )wasm_runtime_malloc (sizeof (uint32_t * ) * n_graphs );
1829+ registry -> model_names =
1830+ (uint32_t * * )wasm_runtime_malloc (sizeof (uint32_t * ) * n_graphs );
1831+ registry -> graph_paths =
1832+ (uint32_t * * )wasm_runtime_malloc (sizeof (uint32_t * ) * n_graphs );
18261833 memset (registry -> target , 0 , sizeof (uint32_t * ) * n_graphs );
18271834 memset (registry -> encoding , 0 , sizeof (uint32_t * ) * n_graphs );
18281835 memset (registry -> loaded , 0 , sizeof (uint32_t * ) * n_graphs );
@@ -1858,15 +1865,15 @@ wasm_runtime_wasi_nn_registry_destroy(WASINNRegistry *registry)
18581865 for (uint32_t i = 0 ; i < registry -> n_graphs ; i ++ )
18591866 if (registry -> graph_paths [i ]) {
18601867 wasm_runtime_free (registry -> graph_paths [i ]);
1861- if (registry -> model_names [i ])
1862- wasm_runtime_free (registry -> model_names [i ]);
1868+ if (registry -> model_names [i ])
1869+ wasm_runtime_free (registry -> model_names [i ]);
18631870 }
1864- if (registry -> encoding )
1865- wasm_runtime_free (registry -> encoding );
1866- if (registry -> target )
1867- wasm_runtime_free (registry -> target );
1868- if (registry -> loaded )
1869- wasm_runtime_free (registry -> loaded );
1871+ if (registry -> encoding )
1872+ wasm_runtime_free (registry -> encoding );
1873+ if (registry -> target )
1874+ wasm_runtime_free (registry -> target );
1875+ if (registry -> loaded )
1876+ wasm_runtime_free (registry -> loaded );
18701877 wasm_runtime_free (registry );
18711878 }
18721879}
0 commit comments