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

Possible *small* memory leak? #92

Open
ghost opened this issue Dec 28, 2020 · 4 comments
Open

Possible *small* memory leak? #92

ghost opened this issue Dec 28, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 28, 2020

While testing my program for memory leaks with valgrind, i happened to stumble upon 4 bytes that plibsys allocates not being freed.... while 4 bytes doesn't hugely matter, seeing as plibsys' goal is to run on embedded systems, possibly there it could mean a bit more? Image of the valgrind output, which also states where in the library you might find the memory leak.
2020-12-27_23-16

@ghost ghost changed the title Possibly memory leak? Possible *small* memory leak? Dec 28, 2020
@ghost
Copy link
Author

ghost commented Dec 28, 2020

I will try the git master version, currently using latest release version, which is 0.4
Found out what might be the reason... very quick and simple fix if the git master version also still has the issue

@ghost
Copy link
Author

ghost commented Dec 28, 2020

Fix... all i really did add was 2 extra lines at the bottom...
image
Also, now no memory leaks reported by valgrind...
image

@ghost
Copy link
Author

ghost commented Dec 28, 2020

Seems like master still has the "bug"
image
like i said, doesn't hugely matter, and im just glad you even made the library! Good job for almost leak free portable library, it really does make my life easier when i want to port my applications to other operating systems.

@TheRealMichaelWang
Copy link

I don't really think this is a bug. There's a puthread_replace_local(or some function like that) that actually calls the destructor. I don't think calling the behavior is intended behavior for set local.

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