[cfe-commits] r84601 - /cfe/trunk/lib/Rewrite/RewriteRope.cpp
kremenek at apple.com
Mon Oct 19 22:25:12 PDT 2009
Date: Tue Oct 20 00:25:11 2009
New Revision: 84601
Fix a reference count imbalance in RewriteRope::MakeRopeString().
This was causing a ton of memory to be leaked when using HTML
diagnostics with the static analyzer (on large files with many errors).
--- cfe/trunk/lib/Rewrite/RewriteRope.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteRope.cpp Tue Oct 20 00:25:11 2009
@@ -798,9 +798,8 @@
memcpy(AllocBuffer->Data, Start, Len);
AllocOffs = Len;
- // Start out the new allocation with a refcount of 1, since we have an
- // internal reference to it.
+ // Return a RopePiece that wraps 'AllocBuffer'. The constructor of RopePiece
+ // will increment the reference count of AllocBuffer.
return RopePiece(AllocBuffer, 0, Len);
More information about the cfe-commits