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

Method CopyOnWrite

include/tvm/ffi/container/array.h:661–669  ·  view source on GitHub ↗

! * \brief Copy on write semantics * Do nothing if current handle is the unique copy of the array. * Otherwise make a new copy of the array to ensure the current handle * hold a unique copy. * * \return Handle to the internal node container(which ganrantees to be unique) */

Source from the content-addressed store, hash-verified

659 * \return Handle to the internal node container(which ganrantees to be unique)
660 */
661 ArrayObj* CopyOnWrite() {
662 if (data_ == nullptr) {
663 return SwitchContainer(ArrayObj::kInitSize);
664 }
665 if (!data_.unique()) {
666 return SwitchContainer(capacity());
667 }
668 return static_cast<ArrayObj*>(data_.get());
669 }
670
671 /*! \brief specify container node */
672 using ContainerType = ArrayObj;

Callers

nothing calls this directly

Calls 2

uniqueMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected