Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: optimizing the logic for retrieving free memory on iOS 13+ #552

Closed
wants to merge 2 commits into from
Closed
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: 6 additions & 0 deletions Sources/KSCrashRecording/Monitors/KSCrashMonitor_System.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#endif
#include <mach-o/dyld.h>
#include <mach/mach.h>
#include <os/proc.h>

typedef struct {
const char *systemName;
Expand Down Expand Up @@ -161,6 +162,11 @@

static uint64_t freeMemory(void)
{
#if ASTROLABECRASH_HOST_IOS
GLinnik21 marked this conversation as resolved.
Show resolved Hide resolved
if(@available(iOS 13.0, *)) {

Check failure on line 166 in Sources/KSCrashRecording/Monitors/KSCrashMonitor_System.m

View workflow job for this annotation

GitHub Actions / Formatting Check

Sources/KSCrashRecording/Monitors/KSCrashMonitor_System.m:166:7: error: code should be clang-formatted [-Wclang-format-violations]
GLinnik21 marked this conversation as resolved.
Show resolved Hide resolved
return os_proc_available_memory();
}
#endif
vm_statistics_data_t vmStats;
vm_size_t pageSize;
if (VMStats(&vmStats, &pageSize)) {
Expand Down
Loading