You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
staticfreeMemory(): number {constKERN_SUCCESS=0;constHOST_VM_INFO=2;consthostSize=newinterop.Reference(interop.sizeof(vm_statistics64)/interop.sizeof(interop.types.int64));consthostPort=mach_host_self();constpageSize=newinterop.Reference(0);host_page_size(hostPort,pageSize);constvmStat=interop.alloc(interop.sizeof(vm_statistics64));letfreeMem=-1;if(host_statistics64(hostPort,HOST_VM_INFO,vmStat,hostSize)===KERN_SUCCESS){constvmStatRef=newinterop.Reference<vm_statistics64>(vm_statistics64,vmStat);freeMem=vmStatRef.value.free_count*pageSize.value;}returnfreeMem;}
I also tried vm_statistics instead of vm_statistics64 and that too failed as well!
32-bit implementation
staticfreeMemory(): number {constKERN_SUCCESS=0;constHOST_VM_INFO=2;consthostSize=newinterop.Reference(interop.sizeof(vm_statistics)/interop.sizeof(interop.types.int32));consthostPort=mach_host_self();constpageSize=newinterop.Reference(0);host_page_size(hostPort,pageSize);constvmStat=interop.alloc(interop.sizeof(vm_statistics));letfreeMem=-1;if(host_statistics(hostPort,HOST_VM_INFO,vmStat,hostSize)===KERN_SUCCESS){constvmStatRef=newinterop.Reference<vm_statistics>(vm_statistics,vmStat);freeMem=vmStatRef.value.free_count*pageSize.value;}returnfreeMem;}
The text was updated successfully, but these errors were encountered:
Hi everyone,
I need your help to understand why the
vmStatRef.value.free_count
in the below code returnsundefine
value.I am using
NativeScript 8.1
. The platform isiOS
.The git repository is https://github.com/DeepakArora76/nativescript-dna-deviceinfo
Here is a 64-bit implementation
I also tried
vm_statistics
instead ofvm_statistics64
and that too failed as well!32-bit implementation
The text was updated successfully, but these errors were encountered: