[LLVMdev] Memory leaks revisited (and many fixed)

Morten Ofstad morten at hue.no
Mon Nov 22 08:17:50 PST 2004


Bill Wendling wrote:
> } Hmmm, I was planning to call clearAllValueMaps once in a while to clear 
> } out the float constants which are building up on me... This shouldn't 
> } break anything as it stands, since the constants will be regenerated. 
> } However, deleting True and False will cause big problems. I think I'm 
> } just going to delete True and False directly from our own shutdown code. 
> } That way the leak detector won't complain and I can use 
> } clearAllValueMaps as I planned...
> } 
> Would it work better just to replace all direct references to
> "ConstantBool::{True,False}" with the appropriate
> "ConstantBool::get({true,false})" and then remove public access to the
> variables?

Yes, this would be the proper way to do it. It would also help prevent 
problems related to static initializer order. But I searched the code 
and there are a lot of direct references - it seems it's not worth the 
trouble. At least for me it's not necessary, since I managed to make a 
hack to shut up the leak detector anyway...

m.





More information about the llvm-dev mailing list