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

Function Any_AnyView_FromObjectPtr

examples/abi_overview/example_code.c:61–72  ·  view source on GitHub ↗

[Any_AnyView.FromObjectPtr.begin]

Source from the content-addressed store, hash-verified

59
60// [Any_AnyView.FromObjectPtr.begin]
61TVMFFIAny Any_AnyView_FromObjectPtr(TVMFFIObject* obj) {
62 TVMFFIAny any;
63 assert(obj != NULL);
64 any.type_index = kTVMFFIObject;
65 any.zero_padding = 0;
66 any.v_obj = obj;
67 // Increment refcount if it's Any (owning) instead of AnyView (borrowing)
68 if (IS_OWNING_ANY) {
69 TVMFFIObjectIncRef(obj);
70 }
71 return any;
72}
73// [Any_AnyView.FromObjectPtr.end]
74
75// [Any_AnyView.Destroy.begin]

Callers

nothing calls this directly

Calls 1

TVMFFIObjectIncRefFunction · 0.85

Tested by

no test coverage detected