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

Method InitFromStd

include/tvm/ffi/string.h:188–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186
187 template <typename LargeObj>
188 void InitFromStd(std::string&& other, int32_t large_type_index) {
189 // needs to be reset to none first for exception safety
190 data_.type_index = TypeIndex::kTVMFFINone;
191 data_.zero_padding = 0;
192 TVM_FFI_CLEAR_PTR_PADDING_IN_FFI_ANY(&data_);
193 ObjectPtr<LargeObj> ptr = make_object<BytesObjStdImpl<LargeObj>>(std::move(other));
194 data_.v_obj = details::ObjectUnsafe::MoveObjectPtrToTVMFFIObjectPtr(std::move(ptr));
195 data_.type_index = large_type_index;
196 }
197
198 /*!
199 * \brief Create a new empty space for a string

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected