|
Message-ID: <74da1e8ee8f69c2a9d4a5f19790f7284@smtp.hushmail.com> Date: Mon, 14 May 2012 18:39:17 +0200 From: magnum <john.magnum@...hmail.com> To: john-dev@...ts.openwall.com Subject: Re: Debugging memory leaks On 05/14/2012 02:05 PM, jfoug wrote: >> There seem to be numerous memory leaks in the libclamav code I use in >> RAR. Unfortunately their normal case is a valid archive whereas our >> normal case is random data. In many cases, an early reject results in >> leaked memory. >> >> I have some vague memories of a discussion about giving mem_alloc_tiny a >> "saved state" feature that would probably be perfect here. It could also >> be a performance boost - unrar makes lots of miniscule allocs. > > Is alloca a possibility here? Or is the size of mem alloc's too much? The size is no problem (it often allocates just a few bytes) but the allocations happen in helper functions and need to survive longer so mostly it can't be used. However, it turns out I may have totally missed using some destructor functions after work is done (to my defense, the code is the documentation and it many cases it does free up resources). I'm investigating that. But the mentioned ideas would probably be a good thing anyway, because of lower overhead. magnum
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.