Skip to content

Fix wasm binding memory leaks.#20

Merged
dumganhar merged 18 commits intococos:cocos-masterfrom
dumganhar:386-fix-wasm-memory-leak
Mar 7, 2025
Merged

Fix wasm binding memory leaks.#20
dumganhar merged 18 commits intococos:cocos-masterfrom
dumganhar:386-fix-wasm-memory-leak

Conversation

@dumganhar
Copy link

No description provided.

// template <> void raw_destructor<PxShape>(PxShape *) { /* do nothing */ }
// template <> void raw_destructor<std::vector<PxContactPairPoint*>>(std::vector<PxContactPairPoint*>*) { }
//
call<void>("onContactPersist", cp.shapes[0], cp.shapes[1], contactCount, &gContactPoints, offset);
Copy link
Author

@dumganhar dumganhar Mar 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing the adress &gContactPoints to avoid memory copy which also improve some performance.

@dumganhar dumganhar merged commit 958faf3 into cocos:cocos-master Mar 7, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant