[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Hybird GC issues in lua 5.4
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 23 Dec 2020 11:35:15 -0300
> But I think it can be optimized in the user-defined allocator (maybe) ,
> and a separate string content may be easier to move during the GC to
> avoid memory fragments.
That is a lot that can be done once we abandon malloc/free and start
using a user-defined allocator. We have no intention of following this
> We may add a flexible mechanism for long strings, too.
> For example, a user-defined long string free function to avoid memcpy
> while pushing long strings into VM.
This has been in our list of improvements for some time, but the
details still need some iron. For instance, what to do if one
tries to create a free-defined string which is too short?
Raise an error? Create a short string and call the free function
immediately? Would that free function need some kind of user value?