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 refnanny for utility code #5224

Open
0dminnimda opened this issue Jan 23, 2023 · 0 comments
Open

Use refnanny for utility code #5224

0dminnimda opened this issue Jan 23, 2023 · 0 comments

Comments

@0dminnimda
Copy link
Contributor

0dminnimda commented Jan 23, 2023

The discussion that it's beneficial to have unility code to be tested for memory leaks yielded that responce

We have refnanny for references in generated code, but not utility code.

Note that you can use it also in utility code, if you put in the required declarations and use the refnanny incref/decref/gotref/giveref macros. We just don't normally do it because it's cumbersome to copy all the boiler plate code together and write refnanny code by hand. If it helps here, it might be worth using. (My guess is that there are quite a number of utility code functions that might benefit from this, especially in ObjectHandling.c and Builtins.c, which deal a lot with object references.

Originally posted by @scoder in #5219 (comment)

I think that it's gonna be nice to simplify initialisation and use of refnanny so it could be used i utility code as well

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

No branches or pull requests

1 participant