Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: Source/wtf/text/StringImpl.cpp

Issue 23901002: [blink]: Annotate StringImpl::createStatic leak for LeakSanitizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed abarth comments. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/wtf/LeakAnnotations.h ('k') | Source/wtf/wtf.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/StringImpl.cpp
diff --git a/Source/wtf/text/StringImpl.cpp b/Source/wtf/text/StringImpl.cpp
index f4ff9a4053596360ca71dbc563f29ff5117c5d23..5a4d1844ad68c67a4313f6bd37b0b2db228820fe 100644
--- a/Source/wtf/text/StringImpl.cpp
+++ b/Source/wtf/text/StringImpl.cpp
@@ -25,6 +25,7 @@
#include "config.h"
#include "wtf/text/StringImpl.h"
+#include "wtf/LeakAnnotations.h"
#include "wtf/StdLibExtras.h"
#include "wtf/text/AtomicString.h"
#include "wtf/text/StringBuffer.h"
@@ -345,6 +346,7 @@ StringImpl* StringImpl::createStatic(const char* string, unsigned length, unsign
// heap allocation from this call.
RELEASE_ASSERT(length <= ((std::numeric_limits<unsigned>::max() - sizeof(StringImpl)) / sizeof(LChar)));
size_t size = sizeof(StringImpl) + length * sizeof(LChar);
+ WTF_ANNOTATE_SCOPED_MEMORY_LEAK;
StringImpl* impl = static_cast<StringImpl*>(fastMalloc(size));
LChar* data = reinterpret_cast<LChar*>(impl + 1);
« no previous file with comments | « Source/wtf/LeakAnnotations.h ('k') | Source/wtf/wtf.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698