Changeset 180359 in webkit
- Timestamp:
- Feb 19, 2015 12:42:52 PM (9 years ago)
- Location:
- trunk/Source/bmalloc
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/bmalloc/ChangeLog
r180272 r180359 1 2015-02-19 Geoffrey Garen <ggaren@apple.com> 2 3 bmalloc should implement malloc introspection (to stop false-positive leaks when MallocStackLogging is off) 4 https://bugs.webkit.org/show_bug.cgi?id=141802 5 6 Reviewed by Andreas Kling. 7 8 This patch does the bare minimum to stop false positive leaks from 9 being reported by the Darwin leaks tool. We register each super chunk 10 as a single object, and then request that the leaks tool scan it. 11 12 * bmalloc.xcodeproj/project.pbxproj: Added an abstraction for the malloc 13 zone introspection API. 14 15 * bmalloc/Algorithm.h: Missing #include. 16 17 * bmalloc/VMHeap.cpp: 18 (bmalloc::VMHeap::grow): 19 * bmalloc/VMHeap.h: Adopt the new abstraction. 20 21 * bmalloc/Zone.cpp: Added. 22 (bmalloc::remoteRead): Helper for reading an object out of another process. 23 (bmalloc::Zone::enumerator): 24 (bmalloc::Zone::Zone): Register a malloc zone so that we will participate 25 in introspection. 26 27 * bmalloc/Zone.h: Added. 28 (bmalloc::Zone::superChunks): 29 (bmalloc::Zone::addSuperChunk): Use a non-dynamically-allocated vector 30 since our dynamic allocations will not be scanned by leaks since they 31 will have the malloc VM tag. 32 1 33 2015-02-18 Geoffrey Garen <ggaren@apple.com> 2 34 -
trunk/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj
r180272 r180359 17 17 143CB81D19022BC900B16A45 /* StaticMutex.h in Headers */ = {isa = PBXBuildFile; fileRef = 143CB81B19022BC900B16A45 /* StaticMutex.h */; settings = {ATTRIBUTES = (Private, ); }; }; 18 18 1440AFC91A95142400837FAA /* SuperChunk.h in Headers */ = {isa = PBXBuildFile; fileRef = 1440AFC81A95142400837FAA /* SuperChunk.h */; settings = {ATTRIBUTES = (Private, ); }; }; 19 1440AFCB1A95261100837FAA /* Zone.h in Headers */ = {isa = PBXBuildFile; fileRef = 1440AFCA1A95261100837FAA /* Zone.h */; settings = {ATTRIBUTES = (Private, ); }; }; 20 1440AFCD1A9527AF00837FAA /* Zone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1440AFCC1A9527AF00837FAA /* Zone.cpp */; }; 19 21 1448C30018F3754600502839 /* mbmalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1448C2FF18F3754300502839 /* mbmalloc.cpp */; }; 20 22 1448C30118F3754C00502839 /* bmalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 1448C2FE18F3754300502839 /* bmalloc.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 93 95 143E29ED18CAE90500FE8A0F /* SmallPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SmallPage.h; path = bmalloc/SmallPage.h; sourceTree = "<group>"; }; 94 96 1440AFC81A95142400837FAA /* SuperChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SuperChunk.h; path = bmalloc/SuperChunk.h; sourceTree = "<group>"; }; 97 1440AFCA1A95261100837FAA /* Zone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Zone.h; path = bmalloc/Zone.h; sourceTree = "<group>"; }; 98 1440AFCC1A9527AF00837FAA /* Zone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Zone.cpp; path = bmalloc/Zone.cpp; sourceTree = "<group>"; }; 95 99 144469E417A46BFE00F9EA1D /* Cache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = Cache.cpp; path = bmalloc/Cache.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 96 100 144469E517A46BFE00F9EA1D /* Cache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = Cache.h; path = bmalloc/Cache.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; … … 261 265 144F7BFB18BFC517003537F3 /* VMHeap.cpp */, 262 266 144F7BFC18BFC517003537F3 /* VMHeap.h */, 267 1440AFCA1A95261100837FAA /* Zone.h */, 268 1440AFCC1A9527AF00837FAA /* Zone.cpp */, 263 269 ); 264 270 name = heap; … … 306 312 14DD788C18F48CAE00950702 /* LargeChunk.h in Headers */, 307 313 14DD789218F48CFC00950702 /* EndTag.h in Headers */, 314 1440AFCB1A95261100837FAA /* Zone.h in Headers */, 308 315 140FA00519CE4B6800FFD3C8 /* LineMetadata.h in Headers */, 309 316 14DD78CC18F48D7500950702 /* PerThread.h in Headers */, … … 434 441 14F271C518EA397E008C152F /* Deallocator.cpp in Sources */, 435 442 14F271C418EA397B008C152F /* Cache.cpp in Sources */, 443 1440AFCD1A9527AF00837FAA /* Zone.cpp in Sources */, 436 444 ); 437 445 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/bmalloc/bmalloc/Algorithm.h
r179927 r180359 28 28 29 29 #include "Algorithm.h" 30 #include "BAssert.h" 30 31 #include <algorithm> 31 32 #include <cstdint> -
trunk/Source/bmalloc/bmalloc/VMHeap.cpp
r180272 r180359 41 41 { 42 42 SuperChunk* superChunk = SuperChunk::create(); 43 m_superChunks.push(superChunk); 43 #if BPLATFORM(DARWIN) 44 m_zone.addSuperChunk(superChunk); 45 #endif 44 46 45 47 SmallChunk* smallChunk = superChunk->smallChunk(); -
trunk/Source/bmalloc/bmalloc/VMHeap.h
r180272 r180359 35 35 #include "SmallChunk.h" 36 36 #include "Vector.h" 37 #if BPLATFORM(DARWIN) 38 #include "Zone.h" 39 #endif 37 40 38 41 namespace bmalloc { … … 62 65 Vector<MediumPage*> m_mediumPages; 63 66 SegregatedFreeList m_largeRanges; 64 Vector<SuperChunk*> m_superChunks; 67 #if BPLATFORM(DARWIN) 68 Zone m_zone; 69 #endif 65 70 }; 66 71
Note: See TracChangeset
for help on using the changeset viewer.