Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/Sentry/SentryCrashWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ - (NSDictionary *)systemInfo
return sharedInfo;
}

- (uint64_t)freeMemory
- (bytes)freeMemory
{
return sentrycrashcm_system_freememory();
}

- (uint64_t)freeStorage
- (bytes)freeStorage
{
return sentrycrashcm_system_freestorage();
}

- (uint64_t)appMemory
- (bytes)appMemory
{
task_vm_info_data_t info;
mach_msg_type_number_t size = TASK_VM_INFO_COUNT;
Expand Down
8 changes: 5 additions & 3 deletions Sources/Sentry/include/SentryCrashWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

NS_ASSUME_NONNULL_BEGIN

typedef uint64_t bytes;

/** A wrapper around SentryCrash for testability.
*/
@interface SentryCrashWrapper : NSObject
Expand Down Expand Up @@ -30,11 +32,11 @@ SENTRY_NO_INIT

- (NSDictionary *)systemInfo;

- (uint64_t)freeMemory;
- (bytes)freeMemory;

- (uint64_t)appMemory;
- (bytes)appMemory;

- (uint64_t)freeStorage;
- (bytes)freeStorage;

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ extern "C" {

#include "SentryCrashMonitor.h"

typedef uint64_t bytes;

/** Access the Monitor API.
*/
SentryCrashMonitorAPI *sentrycrashcm_system_getAPI(void);

bool sentrycrash_isSimulatorBuild(void);

uint64_t sentrycrashcm_system_freememory(void);
uint64_t sentrycrashcm_system_freestorage(void);
bytes sentrycrashcm_system_freememory(void);
bytes sentrycrashcm_system_freestorage(void);

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
return true;
}

static uint64_t
static bytes
freeMemory(void)
{
vm_statistics_data_t vmStats;
Expand All @@ -199,13 +199,13 @@
return 0;
}

uint64_t
bytes
sentrycrashcm_system_freememory(void)
{
return freeMemory();
}

static uint64_t
static bytes
usableMemory(void)
{
vm_statistics_data_t vmStats;
Expand Down Expand Up @@ -486,7 +486,7 @@
return "unknown";
}

static uint64_t
static bytes
getTotalStorageSize()
{
NSNumber *storageSize = [[[NSFileManager defaultManager]
Expand All @@ -495,7 +495,7 @@
return storageSize.unsignedLongLongValue;
}

static uint64_t
static bytes
getFreeStorageSize()
{
NSNumber *storageSize = [[[NSFileManager defaultManager]
Expand Down