Changeset 223936 in webkit
- Timestamp:
- Oct 24, 2017 3:30:15 PM (6 years ago)
- Location:
- trunk/Source/bmalloc
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/bmalloc/ChangeLog
r223877 r223936 1 2017-10-24 David Kilzer <ddkilzer@apple.com> 2 3 Need to pass non-nil argument to SimulateCrash() in bmalloc::logVMFailure() 4 <https://webkit.org/b/178740> 5 <rdar://problem/35154943> 6 7 Reviewed by Saam Barati. 8 9 * bmalloc/BPlatform.h: 10 (BUNUSED_PARAM): Define macro. 11 * bmalloc/Logging.cpp: 12 (SimulateCrash): Change third argument of SimulateCrash() to 13 CFStringRef since it's an NSString * in Objective-C. 14 (bmalloc::logVMFailure): Create a CFStringRef to use as a 15 description string. Use new vmSize parameter to log size. 16 * bmalloc/Logging.h: 17 (bmalloc::logVMFailure): Update function signature to take a 18 size_t parameter representing vmSize. 19 * bmalloc/VMAllocate.h: 20 (bmalloc::tryVMAllocate): Pass vmSize into logVMFailure(). 21 1 22 2017-10-23 Michael Catanzaro <mcatanzaro@igalia.com> 2 23 -
trunk/Source/bmalloc/bmalloc/BPlatform.h
r221548 r223936 217 217 #define BUSE_OS_LOG 1 218 218 #endif 219 220 /* BUNUSED_PARAM */ 221 #if !defined(BUNUSED_PARAM) 222 #define BUNUSED_PARAM(variable) (void)variable 223 #endif -
trunk/Source/bmalloc/bmalloc/Logging.cpp
r201983 r223936 33 33 34 34 #if BPLATFORM(IOS) 35 #include <CoreFoundation/CoreFoundation.h> 35 36 #include <mach/exception_types.h> 36 37 #include <objc/objc.h> … … 39 40 #include "BSoftLinking.h" 40 41 BSOFT_LINK_PRIVATE_FRAMEWORK(CrashReporterSupport); 41 BSOFT_LINK_FUNCTION(CrashReporterSupport, SimulateCrash, BOOL, (pid_t pid, mach_exception_data_type_t exceptionCode, iddescription), (pid, exceptionCode, description));42 BSOFT_LINK_FUNCTION(CrashReporterSupport, SimulateCrash, BOOL, (pid_t pid, mach_exception_data_type_t exceptionCode, CFStringRef description), (pid, exceptionCode, description)); 42 43 #endif 43 44 44 45 namespace bmalloc { 45 46 46 void logVMFailure( )47 void logVMFailure(size_t vmSize) 47 48 { 48 49 #if BPLATFORM(IOS) 49 50 const mach_exception_data_type_t kExceptionCode = 0xc105ca11; 50 SimulateCrash(getpid(), kExceptionCode, nullptr); 51 CFStringRef description = CFStringCreateWithFormat(kCFAllocatorDefault, nullptr, CFSTR("bmalloc failed to mmap %lu bytes"), vmSize); 52 SimulateCrash(getpid(), kExceptionCode, description); 53 CFRelease(description); 54 #else 55 BUNUSED_PARAM(vmSize); 51 56 #endif 52 57 } -
trunk/Source/bmalloc/bmalloc/Logging.h
r201969 r223936 27 27 28 28 #include "BPlatform.h" 29 #include <stddef.h> 29 30 30 31 namespace bmalloc { 31 32 32 void logVMFailure( );33 void logVMFailure(size_t vmSize); 33 34 34 35 #if !BUSE(OS_LOG) -
trunk/Source/bmalloc/bmalloc/VMAllocate.h
r221548 r223936 124 124 void* result = mmap(0, vmSize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | BMALLOC_NORESERVE, BMALLOC_VM_TAG, 0); 125 125 if (result == MAP_FAILED) { 126 logVMFailure( );126 logVMFailure(vmSize); 127 127 return nullptr; 128 128 }
Note: See TracChangeset
for help on using the changeset viewer.