Skip to content
New issue

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

当pushstring发现缓冲长度不足时扩大缓冲长度 #1185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Magicqy
Copy link
Contributor

@Magicqy Magicqy commented Feb 13, 2025

对外业务使用的pushstring接口中没有自动扩大缓冲数组的长度,这里是否应该和内部接口的行为保持一致?

@tencent-adm
Copy link
Member

tencent-adm commented Feb 13, 2025

CLA assistant check
All committers have signed the CLA.

@Magicqy
Copy link
Contributor Author

Magicqy commented Feb 13, 2025

注意到2.1.14版本中增加了一处说明可以使用NATIVE_LUA_PUSHSTRING来开启一个更高效的字符串传递
看实现是使用了DllImport的方式直接使用非托管的lua_pushstring方法
这个过程中C#的string需要使用CLR封送机制分配char*内存来传递到非托管方法中
难道不是比默认使用的strBuff更低效么,不太明白为何说NATIVE_LUA_PUSHSTRING是一个更高效的方式?

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.

2 participants