|
|
@@ -9,6 +9,8 @@
|
|
|
#include "ios.h"
|
|
|
#include "MemoryTexture.h"
|
|
|
|
|
|
+#import <mach/mach.h>
|
|
|
+
|
|
|
namespace oxygine
|
|
|
{
|
|
|
namespace file
|
|
|
@@ -135,4 +137,19 @@ namespace oxygine
|
|
|
return true;
|
|
|
}
|
|
|
#endif
|
|
|
+
|
|
|
+ void iosGetMemoryUsage(size_t &a)
|
|
|
+ {
|
|
|
+ struct task_basic_info info;
|
|
|
+ mach_msg_type_number_t size = sizeof(info);
|
|
|
+ kern_return_t kerr = task_info(mach_task_self(),
|
|
|
+ TASK_BASIC_INFO,
|
|
|
+ (task_info_t)&info,
|
|
|
+ &size);
|
|
|
+ if( kerr == KERN_SUCCESS ) {
|
|
|
+ a = info.resident_size;
|
|
|
+ } else {
|
|
|
+ a = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|