Skip to content

Commit

Permalink
Faster sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
noahsmartin committed Nov 26, 2024
1 parent 01e1b0f commit 3c18954
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Unwinding/Crashlytics/Crashlytics/Helpers/FIRCLSUtility.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ bool FIRCLSReadMemory(vm_address_t src, void* dest, size_t len) {

vm_size_t readSize = len;

return vm_read_overwrite(mach_task_self(), src, len, (pointer_t)dest, &readSize) == KERN_SUCCESS;
// Originally this was a `vm_read_overwrite` to protect against reading invalid memory.
// That can happen in the context of a crash reporter, but should not happen during normal
// ettrace operation. Replacing it with memcpy makes this about 5x faster
// return vm_read_overwrite(mach_task_self(), src, len, (pointer_t)dest, &readSize) == KERN_SUCCESS;
memcpy(dest, src, len);
return true;
}

bool FIRCLSReadString(vm_address_t src, char** dest, size_t maxlen) {
Expand Down

0 comments on commit 3c18954

Please sign in to comment.