X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/b5d655f7532a546b54809da387f7467d128a756b..a28bf75d63c6a64e4c3b417c6052e45f42c6cedd:/include/libkern/OSMemoryNotification.h diff --git a/include/libkern/OSMemoryNotification.h b/include/libkern/OSMemoryNotification.h index ee6714b..d4e450b 100644 --- a/include/libkern/OSMemoryNotification.h +++ b/include/libkern/OSMemoryNotification.h @@ -25,6 +25,7 @@ #define _OSMEMORYNOTIFICATION_H_ #include +#include /* ** OSMemoryNotification.h @@ -33,6 +34,9 @@ ** pressure reaches certain thresholds. Notifications are triggered in both directions ** so clients can manage their memory usage more and less aggressively. ** +** All of these functions and data types are iOS-only and deprecated in iOS 5.0. Applications +** should listen to UIKit memory warnings (didReceiveMemoryWarning or +** UIApplicationDidReceiveMemoryWarningNotification) instead. */ __BEGIN_DECLS @@ -41,12 +45,16 @@ struct timeval; /* ** Opaque type for notification object +** +** DEPRECATED. Use UIKit memory notification system. */ typedef struct _OSMemoryNotification * OSMemoryNotificationRef; /* ** Threshold values for notifications +** +** DEPRECATED. Use UIKit memory notification system. */ typedef enum { @@ -62,37 +70,51 @@ typedef enum { ** returns: 0 on success ** ENOMEM if insufficient memory or resources exists to create the notification object ** EINVAL if the threshold is not a valid notification level +** +** DEPRECATED. Use UIKit memory notification system. */ -int OSMemoryNotificationCreate(OSMemoryNotificationRef *note); +int OSMemoryNotificationCreate(OSMemoryNotificationRef *note) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA, __MAC_NA, __IPHONE_2_0, __IPHONE_5_0); /* ** returns: 0 on success ** EINVAL if the notification is not an initialized notification object + ** + ** DEPRECATED. Use UIKit memory notification system. */ -int OSMemoryNotificationDestroy(OSMemoryNotificationRef note); +int OSMemoryNotificationDestroy(OSMemoryNotificationRef note) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA, __MAC_NA, __IPHONE_2_0, __IPHONE_5_0); /* ** Block waiting for notification ** returns: 0 on success, with the level that triggered the notification in the level param ** EINVAL if the notification object is invalid ** ETIMEDOUT if abstime passes before notification occurs +** +** 'note' is now ignored. +** +** DEPRECATED. Use UIKit memory notification system. */ -int OSMemoryNotificationWait(OSMemoryNotificationRef note, OSMemoryNotificationLevel *level); -int OSMemoryNotificationTimedWait(OSMemoryNotificationRef note, OSMemoryNotificationLevel *level, const struct timeval *abstime); +int OSMemoryNotificationWait(OSMemoryNotificationRef note, OSMemoryNotificationLevel *level) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA, __MAC_NA, __IPHONE_2_0, __IPHONE_5_0); +int OSMemoryNotificationTimedWait(OSMemoryNotificationRef note, OSMemoryNotificationLevel *level, const struct timeval *abstime) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA, __MAC_NA, __IPHONE_2_0, __IPHONE_5_0); /* ** Simple polling interface to detect current memory pressure level +** +** DEPRECATED. This is not a reliable way to discover the system's memory condition and +** the level is not meaningful in iOS 5.0 and later. Use UIKit memory notification +** system instead, with no need to check the level. */ -OSMemoryNotificationLevel OSMemoryNotificationCurrentLevel(void); +OSMemoryNotificationLevel OSMemoryNotificationCurrentLevel(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA, __MAC_NA, __IPHONE_2_0, __IPHONE_5_0); /* ** External notify(3) string for manual notification setup +** +** DEPRECATED. Use UIKit memory notification system. */ -extern const char *kOSMemoryNotificationName; +extern const char *kOSMemoryNotificationName __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA, __MAC_NA, __IPHONE_2_0, __IPHONE_5_0); __END_DECLS