MCPcopy Create free account
hub / github.com/cocos/cocos-engine / reset

Method reset

native/cocos/core/ArrayBuffer.cpp:73–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void ArrayBuffer::reset(const uint8_t *data, uint32_t length) {
74 if (_jsArrayBuffer != nullptr) {
75 _jsArrayBuffer->unroot();
76 _jsArrayBuffer->decRef();
77 }
78 _jsArrayBuffer = se::Object::createArrayBufferObject(data, length);
79 _jsArrayBuffer->getArrayBufferData(static_cast<uint8_t **>(&_data), nullptr);
80 _byteLength = length;
81}
82
83} // namespace cc

Callers

nothing calls this directly

Calls 3

unrootMethod · 0.45
decRefMethod · 0.45
getArrayBufferDataMethod · 0.45

Tested by

no test coverage detected