HashingDeepLearning icon indicating copy to clipboard operation
HashingDeepLearning copied to clipboard

Memory leaks

Open deni64k opened this issue 5 years ago • 3 comments

I noticed wrong usage of delete. For instance here: https://github.com/keroro824/HashingDeepLearning/blob/e5a2078c575b8786698c0eb354dd20852be1fdcf/SLIDE/Layer.cpp#L109

Such expressions destroy only their first operand, ignoring everything followed by comma. More precisely, comma is an operator that divides delete-expression into two independent parts.

deni64k avatar Mar 09 '20 16:03 deni64k

@deni64k thanks for catching this!

keroro824 avatar Mar 10 '20 06:03 keroro824

thanks for catching this!

I want asked why they didn't edit the notice of @deni64k.

Eslam2011 avatar Apr 02 '21 14:04 Eslam2011

I just stumbled upon this project and found that a lot of the code is not very C++'ish. There is also the fact that it re-allocates all the memory for every iteration with fixed size buffers. I believe a lot of code can be simplified by using std::vector instead of new/delete. I might try to refactor some of it at some point if no one beats me to it.

ZehMatt avatar Apr 08 '21 09:04 ZehMatt