|
75 | 75 | int parentProcessID; |
76 | 76 | const char *deviceAppHash; |
77 | 77 | const char *buildType; |
78 | | - bytes totalStorageSize; |
79 | | - bytes freeStorageSize; |
80 | 78 | bytes memorySize; |
81 | 79 | } SystemData; |
82 | 80 |
|
|
494 | 492 | return "unknown"; |
495 | 493 | } |
496 | 494 |
|
497 | | -static bytes |
498 | | -getTotalStorageSize(void) |
499 | | -{ |
500 | | - NSNumber *storageSize = [[[NSFileManager defaultManager] |
501 | | - attributesOfFileSystemForPath:NSHomeDirectory() |
502 | | - error:nil] objectForKey:NSFileSystemSize]; |
503 | | - return storageSize.unsignedLongLongValue; |
504 | | -} |
505 | | - |
506 | | -static bytes |
507 | | -getFreeStorageSize(void) |
508 | | -{ |
509 | | - NSNumber *storageSize = [[[NSFileManager defaultManager] |
510 | | - attributesOfFileSystemForPath:NSHomeDirectory() |
511 | | - error:nil] objectForKey:NSFileSystemFreeSize]; |
512 | | - return storageSize.unsignedLongLongValue; |
513 | | -} |
514 | | - |
515 | | -bytes |
516 | | -sentrycrashcm_system_freestorage_size(void) |
517 | | -{ |
518 | | - return getFreeStorageSize(); |
519 | | -} |
520 | | - |
521 | 495 | // ============================================================================ |
522 | 496 | #pragma mark - API - |
523 | 497 | // ============================================================================ |
|
598 | 572 | g_systemData.parentProcessID = getppid(); |
599 | 573 | g_systemData.deviceAppHash = getDeviceAndAppHash(); |
600 | 574 | g_systemData.buildType = getBuildType(); |
601 | | - g_systemData.totalStorageSize = getTotalStorageSize(); |
602 | | - g_systemData.freeStorageSize = getFreeStorageSize(); |
603 | 575 | g_systemData.memorySize = sentrycrashsysctl_uint64ForName("hw.memsize"); |
604 | 576 | } |
605 | 577 | } |
|
652 | 624 | COPY_REFERENCE(parentProcessID); |
653 | 625 | COPY_REFERENCE(deviceAppHash); |
654 | 626 | COPY_REFERENCE(buildType); |
655 | | - COPY_REFERENCE(totalStorageSize); |
656 | | - COPY_REFERENCE(freeStorageSize); |
657 | 627 | COPY_REFERENCE(memorySize); |
658 | 628 | eventContext->System.freeMemorySize = freeMemorySize(); |
659 | 629 | eventContext->System.usableMemorySize = usableMemorySize(); |
|
0 commit comments