Post

Replies

Boosts

Views

Activity

Reply to how XCode to calculate Memory
memoryFootprint is quite confusing code but useful. Putting it in the debugger and studying info (at line return info.phys_footprint) I see it has a field limit_bytes_remaining Is this a useful guideline as to how much memory is available for allocation? I notice that when UIGraphicsBeginImageContextWithOptions(size,....) fails with a message "Cannot allocate X bytes" X is 16 x size.width x size.height I would like to know if UIGraphicsBeginImageContextWithOptions will fail before I call it and crash
Topic: App & System Services SubTopic: Core OS Tags:
Dec ’21
Reply to What are the meanings of the fields in mach_task_basic_info()
I found this: #define MACH_TASK_BASIC_INFO 20 /* always 64-bit basic info */ struct mach_task_basic_info { mach_vm_size_t virtual_size; /* virtual memory size (bytes) */ mach_vm_size_t resident_size; /* resident memory size (bytes) */ mach_vm_size_t resident_size_max; /* maximum resident memory size (bytes) */ time_value_t user_time; /* total user run time for * terminated threads */ time_value_t system_time; /* total system run time for * terminated threads */ policy_t policy; /* default policy for new threads */ integer_t suspend_count; /* suspend count for task */ }; This is in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer//SDKs/MacOSX.sdk/usr/include/mach/task_info.h
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’21
Reply to how XCode to calculate Memory
class func availableMemory() -> size_t { return os_proc_available_memory() } Cannot find 'os_proc_available_memory' in scope Is there a version I can access from Swift?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to how XCode to calculate Memory
memoryFootprint is quite confusing code but useful. Putting it in the debugger and studying info (at line return info.phys_footprint) I see it has a field limit_bytes_remaining Is this a useful guideline as to how much memory is available for allocation? I notice that when UIGraphicsBeginImageContextWithOptions(size,....) fails with a message "Cannot allocate X bytes" X is 16 x size.width x size.height I would like to know if UIGraphicsBeginImageContextWithOptions will fail before I call it and crash
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to UIImageWriteToSavedPhotosAlbum unreliable
This is ongoing. I simplified the code to: import UIKit func SaveImageAsPhoto(image:UIImage) { UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil) } and I get the same results. At best it works half the time.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to UIImageWriteToSavedPhotosAlbum unreliable
Do I need to use a semephore to serialise the callback? If I call UIImageWriteToSavedPhotosAlbum twice without waiting for the callback to complete will the second call fail silently?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Dec ’21
Reply to What are the meanings of the fields in mach_task_basic_info()
I found this: #define MACH_TASK_BASIC_INFO 20 /* always 64-bit basic info */ struct mach_task_basic_info { mach_vm_size_t virtual_size; /* virtual memory size (bytes) */ mach_vm_size_t resident_size; /* resident memory size (bytes) */ mach_vm_size_t resident_size_max; /* maximum resident memory size (bytes) */ time_value_t user_time; /* total user run time for * terminated threads */ time_value_t system_time; /* total system run time for * terminated threads */ policy_t policy; /* default policy for new threads */ integer_t suspend_count; /* suspend count for task */ }; This is in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer//SDKs/MacOSX.sdk/usr/include/mach/task_info.h
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Xcode12 iOS 14 Date Picker UI Testing adjust toPickerWheelValue issue
I need an answer to this too.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21