Authored by 戴强

Merge branch 'dev_master' into 'master'

暴露内存状态查询接口



See merge request !20
... ... @@ -14,4 +14,8 @@ FOUNDATION_EXTERN NSString *const YH_MemroyMetricsEnableKey;
+ (void)setMemoryStatusMonitorEnable:(BOOL)enable;
+ (NSUInteger)appUsedMemory;
+ (NSUInteger)allUsedMemory;
+ (NSUInteger)availableMemory;
@end
... ...
... ... @@ -68,7 +68,6 @@ static YH_DeviceInfoMonitor *yh_globalDeviceInfoMonitor = nil;
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillEnterForegroundNotification object:nil];
}
#pragma mark - utilites
... ... @@ -123,4 +122,16 @@ static YH_DeviceInfoMonitor *yh_globalDeviceInfoMonitor = nil;
return vm_page_size * (vmStats.free_count + vmStats.inactive_count);
}
+ (NSUInteger)appUsedMemory {
return [yh_globalDeviceInfoMonitor appUsedMemory];
}
+ (NSUInteger)allUsedMemory {
return [yh_globalDeviceInfoMonitor allUsedMemory];
}
+ (NSUInteger)availableMemory {
return [yh_globalDeviceInfoMonitor availableMemory];
}
@end
... ...