[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: static strings [was Re: Lua Compile/one time Load?]
- From: 云风 Cloud Wu <cloudwu@...>
- Date: Sat, 21 Oct 2023 07:51:09 +0800
Roberto Ierusalimschy <roberto@inf.puc-rio.br> 于2023年10月20日周五 21:50写道:
> However, if we introduce a callback, it probably would also need a user
> data to be passed to the callback. So, each external string would need
> three pointers of overhead. That could be significant for "short" long
> strings (such as in the range 40~100 bytes).
>
I think a global callback would be OK. For example, using the
metamethod __gc of the string type.
Only external string trigger it.
The callback is not used for releasing, it just report the C pointer
to host program.
--
http://blog.codingnow.com