We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.8.4
all
cocos-engine/native/cocos/core/scene-graph/Node.h
Line 674 in 33b0a50
这里定义的这个 _padding, 无论是 原生c++ 环境, 还是 jsb ,还是js 中, 都没有被使用过. 应该是从 2.x 里遗留的老代码.
No response
.
The text was updated successfully, but these errors were encountered:
它在 Node.cpp 中,
#define NODE_SHARED_MEMORY_BYTE_LENGTH (20)
里面被用来校验 共享内存的大小, 但是完全可以把它删掉, 然后用 _isStatic 来校验, 同时长度改为 19.
我看了 nodejsb.ts 中的代码
// Uint8Array with 3 elements: activeInHierarchy, active, static this._sharedUint8Arr = new Uint8Array(sharedArrayBuffer, 16, 3);
它也没有去读取 _padding .
Sorry, something went wrong.
突然想起来 , 这个是不是本身就是 故意添加的冗余变量? 用来占位, 填补内存空白 , 从而确保共享内存是 偶数 ?
占位用的,确保 js 和 c++ 的内存布局一样。注释里有写。
No branches or pull requests
Cocos Creator version
3.8.4
System information
all
Issue description
cocos-engine/native/cocos/core/scene-graph/Node.h
Line 674 in 33b0a50
这里定义的这个 _padding, 无论是 原生c++ 环境, 还是 jsb ,还是js 中, 都没有被使用过.
应该是从 2.x 里遗留的老代码.
Relevant error log output
No response
Steps to reproduce
.
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: