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

Side by Side Diff: third_party/WebKit/Source/wtf/text/StringImpl.cpp

Issue 1491253004: Release Oilpan heap singletons prior to LSan leak detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address non-LSan Oilpan compilation failure Created 5 years 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/StdLibExtras.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller ( mueller@kde.org ) 4 * (C) 2001 Dirk Mueller ( mueller@kde.org )
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All r ights reserved.
6 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 6 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 ASSERT(!memcmp(string, it->value + 1, length * sizeof(LChar))); 354 ASSERT(!memcmp(string, it->value + 1, length * sizeof(LChar)));
355 return it->value; 355 return it->value;
356 } 356 }
357 357
358 // Allocate a single buffer large enough to contain the StringImpl 358 // Allocate a single buffer large enough to contain the StringImpl
359 // struct as well as the data which it contains. This removes one 359 // struct as well as the data which it contains. This removes one
360 // heap allocation from this call. 360 // heap allocation from this call.
361 RELEASE_ASSERT(length <= ((std::numeric_limits<unsigned>::max() - sizeof(Str ingImpl)) / sizeof(LChar))); 361 RELEASE_ASSERT(length <= ((std::numeric_limits<unsigned>::max() - sizeof(Str ingImpl)) / sizeof(LChar)));
362 size_t size = sizeof(StringImpl) + length * sizeof(LChar); 362 size_t size = sizeof(StringImpl) + length * sizeof(LChar);
363 363
364 WTF_ANNOTATE_SCOPED_MEMORY_LEAK; 364 WTF_INTERNAL_LEAK_SANITIZER_DISABLED_SCOPE;
365 StringImpl* impl = static_cast<StringImpl*>(Partitions::bufferMalloc(size, " WTF::StringImpl")); 365 StringImpl* impl = static_cast<StringImpl*>(Partitions::bufferMalloc(size, " WTF::StringImpl"));
366 366
367 LChar* data = reinterpret_cast<LChar*>(impl + 1); 367 LChar* data = reinterpret_cast<LChar*>(impl + 1);
368 impl = new (impl) StringImpl(length, hash, StaticString); 368 impl = new (impl) StringImpl(length, hash, StaticString);
369 memcpy(data, string, length * sizeof(LChar)); 369 memcpy(data, string, length * sizeof(LChar));
370 #if ENABLE(ASSERT) 370 #if ENABLE(ASSERT)
371 impl->assertHashIsCorrect(); 371 impl->assertHashIsCorrect();
372 #endif 372 #endif
373 373
374 ASSERT(isMainThread()); 374 ASSERT(isMainThread());
(...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after
2109 } else if (localeIdMatchesLang(localeIdentifier, "lt")) { 2109 } else if (localeIdMatchesLang(localeIdentifier, "lt")) {
2110 // TODO(rob.buis) implement upper-casing rules for lt 2110 // TODO(rob.buis) implement upper-casing rules for lt
2111 // like in StringImpl::upper(locale). 2111 // like in StringImpl::upper(locale).
2112 } 2112 }
2113 } 2113 }
2114 2114
2115 return toUpper(c); 2115 return toUpper(c);
2116 } 2116 }
2117 2117
2118 } // namespace WTF 2118 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/StdLibExtras.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698