MCPcopy Create free account
hub / github.com/apache/tvm-ffi / Any_AnyView_Destroy

Function Any_AnyView_Destroy

examples/abi_overview/example_code.c:76–85  ·  view source on GitHub ↗

[Any_AnyView.Destroy.begin]

Source from the content-addressed store, hash-verified

74
75// [Any_AnyView.Destroy.begin]
76void Any_AnyView_Destroy(TVMFFIAny* any) {
77 if (IS_OWNING_ANY) {
78 // Checks if `any` holds a heap-allocated object,
79 // and if so, decrements the reference count
80 if (any->type_index >= kTVMFFIStaticObjectBegin) {
81 TVMFFIObjectDecRef(any->v_obj);
82 }
83 }
84 *any = (TVMFFIAny){0}; // Clears the `any` struct
85}
86// [Any_AnyView.Destroy.end]
87
88// [Any_AnyView.GetInt_Float.begin]

Callers

nothing calls this directly

Calls 1

TVMFFIObjectDecRefFunction · 0.85

Tested by

no test coverage detected