Skip to content

Add masa deconstructor #2

@nicholasmalaya

Description

@nicholasmalaya

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

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions