Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Created by
brew bump
Created with
brew bump-formula-pr
.release notes
table.clone
(fixes #1617).Magic Functions Migration Note
We've made a change to the API used to define magic functions.
Previously, we had a set of function pointers on each
FunctionType
that would be invoked by the type inference engine at the correct point.The problem we'd run into is that they were all
std::function
s, we'd grown quite a few of them, and Luau allocates tens of thousands of types as it performs type inference. This adds up to a large amount of memory for data that isn't used by 99% of types.To slim things down a bit, we've replaced all of those
std::function
s with a singleshared_ptr
to a new interface calledMagicFunction
. This slims down the memory footprint of each type by about 50 bytes.The virtual methods of
MagicFunction
have roughly 1:1 correspondence with the old interface, so updating things should not be too difficult:FunctionType::magicFunction
is nowMagicFunction::handleOldSolver
FunctionType::dcrMagicFunction
is nowMagicFunction::infer
FunctionType::dcrMagicRefinement
is nowMagicFunction::refine
FunctionType::dcrMagicTypeCheck
is nowMagicFunction::typeCheck
Full Changelog: luau-lang/luau@0.657...0.658
Co-authored-by: Andy Friesen [email protected]
Co-authored-by: Ariel Weiss [email protected]
Co-authored-by: Aviral Goel [email protected]
Co-authored-by: Hunter Goldstein [email protected]
Co-authored-by: Talha Pathan [email protected]
Co-authored-by: Varun Saini [email protected]
Co-authored-by: Vighnesh Vijay [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]