Skip to content
Discussion options

You must be logged in to vote

Hello!

The main function used in those tools is luaC_enumheap, you can use that to build a whole graph of objects in memory.

For an open-source implementation, it is also similar to the way luaC_dump generates a JSON file you can send into https://github.com/luau-lang/luau/blob/master/tools/perfstat.py and https://github.com/luau-lang/luau/blob/master/tools/perfgraph.py

Finally, you can use lua_callbacks and onallocate callback to collect information on call stack of every allocation (expensive for performance, but useful for other kinds of analysis).

We have plans to make these luaC_* functions a part of the public C API in the future, but our roadmap is filled with other things for now.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Polanas
Comment options

Answer selected by Polanas
Comment options

You must be logged in to vote
2 replies
@Polanas
Comment options

@vegorov-rbx
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants