You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the Parser is used to construct a tree of json objects, these are allocated using an arena allocator. It isn't possible to free memory for a single object in the tree with the current api.
I'm not particularly attached to any method of handling objects. My initial thought for using an arena was to speed up the allocation of many objects and simplify clean-up. Also, I considered that the use-case for a tree is typically as a query object and you want to keep all values in the tree around until you are done. Open to any suggestions to change if it makes sense.
Just to add specifically on your example, the tree.deinit() call will clean up memory after you spawn the thread so you don't need to free that specific path. If you need the path to exist for the thread however, you will need to make your own copy.
I wrote a test to use std.json, the code is here.
In the line 57, I want to destroy the memory for the path, butIt seems that the memory leaked.
Is there a way to destroy the momory for the variable
path
?The text was updated successfully, but these errors were encountered: