MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / print_handle

Function print_handle

utils/wasi-cpp-header/src/cpp_header.rs:309–327  ·  view source on GitHub ↗
(ret: &mut String, name: &Id, h: &HandleDatatype)

Source from the content-addressed store, hash-verified

307}
308
309fn print_handle(ret: &mut String, name: &Id, h: &HandleDatatype) {
310 ret.push_str(&format!(
311 "using __wasi_{}_t = int32_t;\n\n",
312 ident_name(name)
313 ));
314
315 ret.push_str(&format!(
316 "static_assert(sizeof(__wasi_{}_t) == {}, \"witx calculated size\");\n",
317 ident_name(name),
318 h.mem_size()
319 ));
320 ret.push_str(&format!(
321 "static_assert(alignof(__wasi_{}_t) == {}, \"witx calculated align\");\n",
322 ident_name(name),
323 h.mem_align()
324 ));
325
326 ret.push_str("\n");
327}
328
329fn ident_name(i: &Id) -> String {
330 i.as_str().to_string()

Callers 1

print_datatypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected