Yes, this seems to be fixed on HEAD now;<div><br></div><div><div>==2588== LEAK SUMMARY:</div><div>==2588== definitely lost: 0 bytes in 0 blocks</div><div>==2588== indirectly lost: 0 bytes in 0 blocks</div><div>==2588== possibly lost: 0 bytes in 0 blocks</div>
<div>==2588== still reachable: 64 bytes in 3 blocks</div><div>==2588== suppressed: 0 bytes in 0 blocks</div></div><div><br></div><div>Cheers,</div><div>Doug.<br><br><div class="gmail_quote">On Tue, Nov 29, 2011 at 3:19 AM, Argyrios Kyrtzidis <span dir="ltr"><<a href="mailto:kyrtzidis@apple.com">kyrtzidis@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">There was a memory leak fixed by Ted, please try again with latest clang.<br>
<div class="im HOEnZb"><br>
-Argyrios<br>
<br>
On Nov 7, 2011, at 7:55 PM, Doug wrote:<br>
<br>
</div><div class="HOEnZb"><div class="h5">> Humm, when I run valgrind over my code I'm getting:<br>
><br>
> ==30376==<br>
> ==30376== HEAP SUMMARY:<br>
> ==30376== in use at exit: 1,928 bytes in 25 blocks<br>
> ==30376== total heap usage: 28,193 allocs, 28,168 frees, 2,194,616 bytes allocated<br>
> ==30376==<br>
> ==30376== 1,864 (1,056 direct, 808 indirect) bytes in 1 blocks are definitely lost in loss record 15 of 15<br>
> ==30376== at 0x4C28973: operator new(unsigned long) (vg_replace_malloc.c:261)<br>
> ==30376== by 0x57C7A62: clang::ASTUnit::Parse(llvm::MemoryBuffer*) (in /home/doug/projects/cparse/deps/llvm/build/lib/liblibclang.so.3.0)<br>
> ==30376== by 0x57CB686: clang::ASTUnit::LoadFromCompilerInvocation(bool) (in /home/doug/projects/cparse/deps/llvm/build/lib/liblibclang.so.3.0)<br>
> ==30376== by 0x57CBF0F: clang::ASTUnit::LoadFromCommandLine(char const**, char const**, llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine>, llvm::StringRef, bool, bool, std::pair<std::string, llvm::PointerUnion<char const*, llvm::MemoryBuffer const*> >*, unsigned int, bool, bool, clang::TranslationUnitKind, bool, bool) (in /home/doug/projects/cparse/deps/llvm/build/lib/liblibclang.so.3.0)<br>
> ==30376== by 0x54F5E14: clang_parseTranslationUnit_Impl (in /home/doug/projects/cparse/deps/llvm/build/lib/liblibclang.so.3.0)<br>
> ==30376== by 0x5E3BD89: llvm::CrashRecoveryContext::RunSafely(void (*)(void*), void*) (in /home/doug/projects/cparse/deps/llvm/build/lib/liblibclang.so.3.0)<br>
> ==30376== by 0x5E3BE90: RunSafelyOnThread_Dispatch(void*) (in /home/doug/projects/cparse/deps/llvm/build/lib/liblibclang.so.3.0)<br>
> ==30376== by 0x5E72924: ExecuteOnThread_Dispatch(void*) (in /home/doug/projects/cparse/deps/llvm/build/lib/liblibclang.so.3.0)<br>
> ==30376== by 0x6D82970: start_thread (pthread_create.c:304)<br>
> ==30376== by 0x68DA92C: clone (clone.S:112)<br>
> ==30376==<br>
> ==30376== LEAK SUMMARY:<br>
> ==30376== definitely lost: 1,056 bytes in 1 blocks<br>
><br>
> I'm a little lost as to if this is something I'm doing wrong on my code, or some kind of clang internal thing (seems internal, but I wouldnt have expected clang to leak memory, so I suspect perhaps I'm not cleaning up correctly after use?).<br>
><br>
> Any suggestions how to track this down?<br>
><br>
> My code is roughly like:<br>
><br>
> clang_createIndex(...);<br>
> clang_createTranslationUnitFromSourceFile(...);<br>
> clang_getTranslationUnitCursor(...);<br>
> clang_visitChildren(...);<br>
> clang_disposeTranslationUnit(...);<br>
> clang_disposeIndex(...);<br>
><br>
> Is there some other shutdown I need to run?<br>
><br>
> ~<br>
> Doug.<br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
</div></div></blockquote></div><br></div>