Returns an array size suitable for the backing array of a hash table that uses open addressing
with linear probing in its implementation. The returned size is the smallest power of two that
can hold setSize elements with the desired load factor.
499550
@VisibleForTesting
  static int chooseTableSize(int setSize) {
    if (setSize == 1) {
      return 2;
    }
    // Correct the size for open addressing to match desired load factor.
    // Round up to the next highest power of 2.
    int tableSize = Integer.highestOneBit(setSize - 1) << 1;
    while (tableSize * DESIRED_LOAD_FACTOR < setSize) {
      tableSize <<= 1;
    }
    return tableSize;
  }
26320
def array(type)
      # Thanks to Peter Rullmann for this line
      align(4)
      sizeidx = @packet.bytesize
      @packet += "ABCD"
      align(type.alignment)
      contentidx = @packet.bytesize
      yield
      sz = @packet.bytesize - contentidx
      raise InvalidPacketException if sz > 67_108_864
      @packet[sizeidx...sizeidx + 4] = [sz].pack("L")
    end
652115
def bytesize(arr):
    
    byte_size = np.prod(arr.shape) * np.dtype(arr.dtype).itemsize
    return byte_size
1189365
@Override
    public int size () {
        return 4 + ( this.hashAlgos != null ? 2 * this.hashAlgos.length : 0 ) + ( this.salt != null ? this.salt.length : 0 );
    }
1250830
public int size() {
        int retval=0;
        for(int i=0; i < index; i++)
            if(messages[i] != null)
                retval++;
        return retval;
    }
346337
def size(self):
        ''''''
        if self.cache.cache is None:
            return self.read_backend_structure().size()
        else:
            return len(self.cache.cache)
190088
@Override
	public int size() {

		if (allElementsInCache) {
			return orderedCache.size();
		} else {
			int count = 0;
			try (final RocksBytesIterator iterator = orderedBytesIterator()) {
				while (iterator.hasNext()) {
					iterator.next();
					++count;
				}
			}
			return count;
		}
	}
96672
public static long sizeOnHeapOf(ByteBuffer[] array)
    {
        long allElementsSize = 0;
        for (int i = 0; i < array.length; i++)
            if (array[i] != null)
                allElementsSize += sizeOnHeapOf(array[i]);

        return allElementsSize + sizeOfArray(array);
    }
544739
@Override
    public int size() {
        Map<String, GroovyRunner> map = getMap();
        readLock.lock();
        try {
            return map.size();
        } finally {
            readLock.unlock();
        }
    }
964216
public byte[] toByteArray()
    {
        byte[] b = new byte[size()];
        unsafe.copyMemory(base, address, b, ARRAY_BYTE_BASE_OFFSET, size());
        return b;
    }
533238
public Integer getArraySizeAsInt() {
    if (this.arraySize == null) {
      throw new NullPointerException("Array size is not defined");
    }
    try {
      return Integer.valueOf(this.arraySize.trim());
    } catch (NumberFormatException ex) {
      return null;
    }
  }
914453
private final int calcSize () {

        int size = BasicHeaderSegment.BHS_FIXED_SIZE;
        size += basicHeaderSegment.getTotalAHSLength() * AdditionalHeaderSegment.AHS_FACTOR;

        // plus the sizes of the used digests
        size += headerDigest.getSize();
        size += dataDigest.getSize();

        size += AbstractDataSegment.getTotalLength(basicHeaderSegment.getDataSegmentLength());

        return size;
    }
577565
private static int actualArrayLength(int recommended) {
    if (recommended > MAX_ARRAY_LENGTH) {
      return MAX_ARRAY_LENGTH;
    } else if (recommended < MIN_ARRAY_LENGTH) {
      return MIN_ARRAY_LENGTH;
    } else {
      final int a = Integer.highestOneBit(recommended);
      return a == recommended? a: a << 1;
    }
  }
1338834
function(size) {
        var result = 0,
            i;
        this.checkOffset(size);
        for (i = this.index + size - 1; i >= this.index; i--) {
            result = (result << 8) + this.byteAt(i);
        }
        this.index += size;
        return result;
    }
685823
def get_abi_size(self, target_data, context=None):
        
        llty = self._get_ll_pointer_type(target_data, context)
        return target_data.get_pointee_abi_size(llty)
1322050
def get_memory_size(self):
        """"""
        n = sys.getsizeof(self)
        n += sys.getsizeof(self.padding)
        n += total_size(self.start_addr)
        n += total_size(self._buf)
        n += sys.getsizeof(self._offset)
        return n
19358
public int alloc(int size) {
        int index = n;
        int len = array.length;
        if (n + size >= len) {
            byte[] aux = new byte[len + blockSize];
            System.arraycopy(array, 0, aux, 0, len);
            array = aux;
        }
        n += size;
        return index;
    }