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

Zero memory leaks! #8

Open
ghost opened this issue Apr 19, 2014 · 2 comments
Open

Zero memory leaks! #8

ghost opened this issue Apr 19, 2014 · 2 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Apr 19, 2014

KQ v1.0 won't be released until there's absolutely zero memory leaks from KQ itself.
Some libraries like Allegro and Lua may leak, but since theses aren't linked to KQ's source code, they won't be taken into account.

@ghost ghost added this to the KQ v1.0 milestone Apr 19, 2014
@ghost ghost added the bug label Apr 19, 2014
@pedro-w
Copy link
Contributor

pedro-w commented Aug 23, 2022

I've been compiling with -fsanitize=address on Linux for a while and this includes a leak checker phase. I am currently getting 37 bytes leaked from an allocation in SDL but the stack trace is incomplete so I can't see where or if the root cause is our code. I know 37 bytes is not "absolutely zero memory leaks" but we might give ourselves a pass on this one?

@OnlineCop
Copy link
Owner

Some locations we may need to look into are the C memory calls to malloc(), calloc(), memcpy(), memmove(), and memset() for a few things:

  1. They are not used on C++ objects, like std::string or std::vector which will cause issues when the destructor gets called twice.
  2. All malloc()/calloc() memory eventually gets freed (better yet: convert to smart pointers or vectors).
  3. C-style string manipulation functions strcpy(), strncpy(), strcat(), and strlen() are not being used on std::string types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants