-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Expand and clarify the __mode
metaproperty
#1232
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Aseminaunz, thanks so much for helping improve the Roblox creator documentation! Our technical writing team will review your pull request soon. In the meantime, please ensure you've read through the README.md, contribution guidelines, and style recommendations.
"Not all userdata" being garbage collectible might be a mistake now that I've learned Vector3.new simply returns a |
All userdata types as well as well as thread objects (from coroutine and task libraries) are garbage-collectable and can be weak. One other exception are string values.
|
This pull request has been inactive for 14 days. If there's no activity in the next 7 days, it will be automatically closed. To keep it open, please comment or push new commits. Alternatively, add the label |
Changes
Clarified and expanded the use of the
__mode
metaproperty.The current description makes it seem to me as if a reference to a Roblox instance is ALWAYS strong, which is not true. This is only true if the instance isn't parented to
nil
as there is then a reference to it in the datamodel. Weak tables containing Roblox instances are subject to garbage collection, as per my own test:Not all userdata, however, are subject to garbage collection, as duly noted. For example, Vector3:
This expanded explanation also clarifies what "weak" means, and links to the Lua manual for a more in-depth explanation.
Checks
By submitting your pull request for review, you agree to the following: