<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 27, 2013 at 2:10 AM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":1j9" style="overflow:hidden">+  // This function may be called only a small fixed amount of times per each<br>

+  // invocation, otherwise we do actually have a leak which we want to report.<br>
+  // If this function is called more than kGraveYardMaxSize times, the pointers<br>
+  // will not be properly buried and a leak detector will report a leak, which<br>
+  // is what we want in such case.<br></div></blockquote><div><br></div><div>Interesting. I didn't realize it was going to be *that* tightly bounded.</div><div><br></div><div>This makes me wonder if the whole disable free thing should just be removed at this point. Back in the day, we didn't so carefully use a BumpPtrAllocator in the ASTContext. Today, we might be fine to call free 10 times. Anyways, not trying to shift the goal posts; I mostly wanted to mention it in case someone gets some time to look into removing all of the leak stuff.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":1j9" style="overflow:hidden">
+  static const size_t kGraveYardMaxSize = 16;<br>
+  static const void *GraveYard[kGraveYardMaxSize];<br>
+  static llvm::sys::cas_flag GraveYardSize;</div></blockquote><div> </div></div>Do these being function-local statics defeat the purpose of using a basic atomic increment? I can't recall if we correctly eliminate the cxa_guard in these cases...</div>
</div>