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

Use %p (pointer) format as basis for object ids #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Zash
Copy link

@Zash Zash commented Jul 28, 2021

This only works in Lua 5.4 which adds string.format("%p", object).

Pointers are more stable and will have the same value across
invocations, unlike the counter method which may assign different ids to
the same object on each run.

Having stable IDs makes it easier to compare dumps from different times.

Zash added 2 commits July 28, 2021 20:37
This is more explicit, hopefully easier to understand. Can also be
overridden as I intend to do next.
Pointers are more stable and will have the same value across
invocations, unlike the counter method which may assign different ids to
the same object on each run.

Having stable IDs makes it easier to compare dumps from different times.
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.

1 participant