I'm afraid I need to hit the rewind-button. My last journal entry about resolving a memory-leak turned out to be premature. Sure, I did fix a memory-leak, but actually a non-existing one.
"SvPV(sv)"...which, according to perlapi.pod, is a pointer to the string value of
"sv". Thus I had blown up all of my Perl scalar's, oups.
I found out that there was nothing wrong with my code so none of my leaks stemmed from it. Instead the underlying mplib leaks very heavily, as I found out in hourly sessions staring into the debugger and logfiles created by dmalloc (an extremely cool thing if you are an occasional C-programmer, by the way). Even worse, the author of the mplib doesn't seem to respond to my emails (probably too ashamed;-).
I then decided to patch mplib wherever I could. I was able to close a few of the leaks, but some serious ones are still lurking around. That's why I now announce MP3::Mplib to be dead. I will skip to the id3lib which is widely enough used so I expect it to be relatively bug- and leak-free. I have to re-register the namespace but this time I'll wait till the first release is actually on my hard-disk waiting to be uploaded in a tested and non-leaking state.
But that's not too urgent. First I need to recover from memory allocating and deallocating strategies.
I'll now play a little with what I read in jjohn's article. Since I am one of those preferring vim over emacs, I can't use all the listings one-by-one. Making the adaptions to vim should be a real pleasure since this time it really just involves Perl and perhaps a little Bash-scripting.