/** * Returns the number of processor cores available to the VM, at least 1. * Traditionally this returned the number currently online, * but many mobile devices are able to take unused cores offline to * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of * cores that could be made available if there were no power or heat * constraints. */ public int availableProcessors() { return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF); }
public long sysconf(int name) { return os.sysconf(name); } public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
/** * Returns true if there is a high probability that every page of this buffer is currently * loaded in RAM, meaning that accesses will not cause a page fault. It is impossible to give * a strong guarantee since this is only a snapshot of a dynamic situation. */ public final boolean isLoaded() { checkIsMapped(); long address = block.toLong(); long size = block.getSize(); if (size == 0) { return true; } try { int pageSize = (int) Libcore.os.sysconf(_SC_PAGE_SIZE); int pageOffset = (int) (address % pageSize); address -= pageOffset; size += pageOffset; int pageCount = (int) ((size + pageSize - 1) / pageSize); byte[] vector = new byte[pageCount]; Libcore.os.mincore(address, size, vector); for (int i = 0; i < vector.length; ++i) { if ((vector[i] & 1) != 1) { return false; } } return true; } catch (ErrnoException errnoException) { return false; } }
long alignment = position - position % Libcore.os.sysconf(_SC_PAGE_SIZE); int offset = (int) (position - alignment); MemoryBlock block = MemoryBlock.mmap(fd, alignment, size + offset, mapMode);
/** * Returns the number of processor cores available to the VM, at least 1. * Traditionally this returned the number currently online, * but many mobile devices are able to take unused cores offline to * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of * cores that could be made available if there were no power or heat * constraints. */ public int availableProcessors() { return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF); }
/** * Returns the number of processor cores available to the VM, at least 1. * Traditionally this returned the number currently online, * but many mobile devices are able to take unused cores offline to * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of * cores that could be made available if there were no power or heat * constraints. */ public int availableProcessors() { return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF); }
/** * Returns the number of processor cores available to the VM, at least 1. * Traditionally this returned the number currently online, * but many mobile devices are able to take unused cores offline to * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of * cores that could be made available if there were no power or heat * constraints. */ public int availableProcessors() { return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF); }
/** * Returns the number of processor cores available to the VM, at least 1. * Traditionally this returned the number currently online, * but many mobile devices are able to take unused cores offline to * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of * cores that could be made available if there were no power or heat * constraints. */ public int availableProcessors() { return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF); }
/** * Returns the number of processor cores available to the VM, at least 1. * Traditionally this returned the number currently online, * but many mobile devices are able to take unused cores offline to * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of * cores that could be made available if there were no power or heat * constraints. */ public int availableProcessors() { return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF); }
/** * Returns the number of processor cores available to the VM, at least 1. * Traditionally this returned the number currently online, * but many mobile devices are able to take unused cores offline to * save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of * cores that could be made available if there were no power or heat * constraints. */ public int availableProcessors() { return (int) Libcore.os.sysconf(_SC_NPROCESSORS_CONF); }
public long sysconf(int name) { return os.sysconf(name); } public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
public long sysconf(int name) { return os.sysconf(name); } public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
public long sysconf(int name) { return os.sysconf(name); } public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
public long sysconf(int name) { return os.sysconf(name); } public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
public long sysconf(int name) { return os.sysconf(name); } public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
public long sysconf(int name) { return os.sysconf(name); } public void tcdrain(FileDescriptor fd) throws ErrnoException { os.tcdrain(fd); }
/** * Returns true if there is a high probability that every page of this buffer is currently * loaded in RAM, meaning that accesses will not cause a page fault. It is impossible to give * a strong guarantee since this is only a snapshot of a dynamic situation. */ public final boolean isLoaded() { checkIsMapped(); long address = block.toLong(); long size = block.getSize(); if (size == 0) { return true; } try { int pageSize = (int) Libcore.os.sysconf(_SC_PAGE_SIZE); int pageOffset = (int) (address % pageSize); address -= pageOffset; size += pageOffset; int pageCount = (int) ((size + pageSize - 1) / pageSize); byte[] vector = new byte[pageCount]; Libcore.os.mincore(address, size, vector); for (int i = 0; i < vector.length; ++i) { if ((vector[i] & 1) != 1) { return false; } } return true; } catch (ErrnoException errnoException) { return false; } }
/** * Returns true if there is a high probability that every page of this buffer is currently * loaded in RAM, meaning that accesses will not cause a page fault. It is impossible to give * a strong guarantee since this is only a snapshot of a dynamic situation. */ public final boolean isLoaded() { checkIsMapped(); long address = block.toLong(); long size = block.getSize(); if (size == 0) { return true; } try { int pageSize = (int) Libcore.os.sysconf(_SC_PAGE_SIZE); int pageOffset = (int) (address % pageSize); address -= pageOffset; size += pageOffset; int pageCount = (int) ((size + pageSize - 1) / pageSize); byte[] vector = new byte[pageCount]; Libcore.os.mincore(address, size, vector); for (int i = 0; i < vector.length; ++i) { if ((vector[i] & 1) != 1) { return false; } } return true; } catch (ErrnoException errnoException) { return false; } }
/** * Returns true if there is a high probability that every page of this buffer is currently * loaded in RAM, meaning that accesses will not cause a page fault. It is impossible to give * a strong guarantee since this is only a snapshot of a dynamic situation. */ public final boolean isLoaded() { checkIsMapped(); long address = block.toLong(); long size = block.getSize(); if (size == 0) { return true; } try { int pageSize = (int) Libcore.os.sysconf(_SC_PAGE_SIZE); int pageOffset = (int) (address % pageSize); address -= pageOffset; size += pageOffset; int pageCount = (int) ((size + pageSize - 1) / pageSize); byte[] vector = new byte[pageCount]; Libcore.os.mincore(address, size, vector); for (int i = 0; i < vector.length; ++i) { if ((vector[i] & 1) != 1) { return false; } } return true; } catch (ErrnoException errnoException) { return false; } }
/** * Returns true if there is a high probability that every page of this buffer is currently * loaded in RAM, meaning that accesses will not cause a page fault. It is impossible to give * a strong guarantee since this is only a snapshot of a dynamic situation. */ public final boolean isLoaded() { checkIsMapped(); long address = block.toLong(); long size = block.getSize(); if (size == 0) { return true; } try { int pageSize = (int) Libcore.os.sysconf(_SC_PAGE_SIZE); int pageOffset = (int) (address % pageSize); address -= pageOffset; size += pageOffset; int pageCount = (int) ((size + pageSize - 1) / pageSize); byte[] vector = new byte[pageCount]; Libcore.os.mincore(address, size, vector); for (int i = 0; i < vector.length; ++i) { if ((vector[i] & 1) != 1) { return false; } } return true; } catch (ErrnoException errnoException) { return false; } }