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

Add masa deconstructor #2

Open
nicholasmalaya opened this issue Jul 17, 2013 · 0 comments
Open

Add masa deconstructor #2

nicholasmalaya opened this issue Jul 17, 2013 · 0 comments

Comments

@nicholasmalaya
Copy link
Member

Valgrind gives epic warnings about memory leaks from running the masa executable. We need to add a masa deconstructor to close out all allocated memory safely.

No idea on portability beyond GNU and Intel, but the constructor and destructor attributes always look cool to me. They'd act just like a static constant instance (as Roy has suggested using) but would work in C land. Possibly #ifdef and use a static constant instance for C++, these attributes for compilers supporting them (autoconf can detect it), and a big nasty error message saying one must explicitly call masa_init/teardown otherwise.

http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

@ghost ghost assigned nicholasmalaya Jul 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant