/*
The main worker method for sizeof() and sizedelta().
17427
private static long computeSizeof(Object obj, final IdentityHashMap visited,
                                      final Map /* <Class,ClassMetadata> */metadataMap) {
        // this uses depth-first traversal; the exact graph traversal algorithm
        // does not matter for computing the total size and this method could be
        // easily adjusted to do breadth-first instead (addLast() instead of
        // addFirst()),
        // however, dfs/bfs require max queue length to be the length of the
        // longest
        // graph path/width of traversal front correspondingly, so I expect
        // dfs to use fewer resources than bfs for most Java objects;

        if (null == obj || isSharedFlyweight(obj)) {
            return 0;
        }

        final LinkedList queue = new LinkedList();

        visited.put(obj, obj);
        queue.add(obj);

        long result = 0;

        final ClassAccessPrivilegedAction caAction = new ClassAccessPrivilegedAction();
        final FieldAccessPrivilegedAction faAction = new FieldAccessPrivilegedAction();

        while (!queue.isEmpty()) {
            obj = queue.removeFirst();
            final Class objClass = obj.getClass();

            int skippedBytes = skipClassDueToSunJVMBug(objClass);
            if (skippedBytes > 0) {
                result += skippedBytes; // can't do better than that
                continue;
            }

            if (objClass.isArray()) {
                final int arrayLength = Array.getLength(obj);
                final Class componentType = objClass.getComponentType();

                result += sizeofArrayShell(arrayLength, componentType);

                if (!componentType.isPrimitive()) {
                    // traverse each array slot:
                    for (int i = 0; i < arrayLength; ++i) {
                        final Object ref = Array.get(obj, i);

                        if ((ref != null) && !visited.containsKey(ref)) {
                            visited.put(ref, ref);
                            queue.addFirst(ref);
                        }
                    }
                }
            } else { // the object is of a non-array type
                final ClassMetadata metadata = getClassMetadata(objClass, metadataMap, caAction, faAction);
                final Field[] fields = metadata.m_refFields;

                result += metadata.m_shellSize;

                // traverse all non-null ref fields:
                for (int f = 0, fLimit = fields.length; f < fLimit; ++f) {
                    final Field field = fields[f];

                    final Object ref;
                    try { // to get the field value:
                        ref = field.get(obj);
                    } catch (Exception e) {
                        throw new RuntimeException("cannot get field [" + field.getName() + "] of class ["
                                                   + field.getDeclaringClass().getName() + "]: " + e.toString());
                    }

                    if ((ref != null) && !visited.containsKey(ref)) {
                        visited.put(ref, ref);
                        queue.addFirst(ref);
                    }
                }
            }
        }

        return result;
    }
1234448
def size(self, value):
        """"""
        if self._size != value and \
           isinstance(value, (int, float, long)):
            self._size = value
1253161
@Deprecated public static int size (Object[] list)
    {
        if (list == null) {
            return 0;
        }
        int llength = list.length;
        for (int ii = 0; ii < llength; ii++) {
            if (list[ii] == null) {
                return ii;
            }
        }
        return llength;
    }
350382
@Override
	protected void onSizeChanged(int w, int h, int oldw, int oldh) {
		if (w != oldw || h != oldh) {
			mNeedsResize = true;
		}
	}
1250782
def sizeof(self, prim):
        '''
        
        '''
        size = 0
        arraysize = self.size
        if arraysize == 0:
            arraysize = len(prim)
        for i in range(0, arraysize):
            if i >= len(prim):
                tp = self.innerparser.new()
                if hasattr(self.innerparser, 'fullparse'):
                    self.innerparser.fullparse(tp)
                size += self.innerparser.paddingsize(tp)
            else:
                size += self.innerparser.paddingsize(prim[i])
        return size
476806
protected int byCurrentSize(ThreadInfo o1, ThreadInfo o2) {
		double count = o2.getCurrentSize() - o1.getCurrentSize();
		if (count > 0) {
			return 1;
		}
		else if (count == 0) {
			return 0;
		}
		else {
			return -1;
		}
	}
203171
def calculate_size(name, listener_flags, local_only):
    
    data_size = 0
    data_size += calculate_size_str(name)
    data_size += INT_SIZE_IN_BYTES
    data_size += BOOLEAN_SIZE_IN_BYTES
    return data_size
1285613
void setSize(int size) {
        if (this.size != 0) {
            final String fmt = "column size is known: %d";
            final String msg = format(fmt, this.size);
            throw new IllegalStateException(msg);
        }
        this.size = size;
        this.hash = hash();
    }
784770
function StaticWriter(size) {
  if (!(this instanceof StaticWriter))
    return new StaticWriter(size);

  this.data = size ? Buffer.allocUnsafe(size) : EMPTY;
  this.offset = 0;
}
257877
function _Big_() {

    /*
     * The Big constructor and exported function.
     * Create and return a new instance of a Big number object.
     *
     * n {number|string|Big} A numeric value.
     */
    function Big(n) {
      var x = this;

      // Enable constructor usage without new.
      if (!(x instanceof Big)) return n === UNDEFINED ? _Big_() : new Big(n);

      // Duplicate.
      if (n instanceof Big) {
        x.s = n.s;
        x.e = n.e;
        x.c = n.c.slice();
      } else {
        parse(x, n);
      }

      /*
       * Retain a reference to this Big constructor, and shadow Big.prototype.constructor which
       * points to Object.
       */
      x.constructor = Big;
    }

    Big.prototype = P;
    Big.DP = DP;
    Big.RM = RM;
    Big.NE = NE;
    Big.PE = PE;
    Big.version = '5.2.2';

    return Big;
  }
1226924
private void setBufferSize(int size) {

        this.amountToBuffer = size;
        this.bbSize = (49152 < size) ? 32768 : 8192;
        int numBuffers = (size / this.bbSize);
        if (0 == size || 0 != (size % this.bbSize)) {
            numBuffers++;
        }
        this._output = new WsByteBuffer[numBuffers];
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "setBufferSize=[" + size + "]; " + this);
        }
    }
336652
private int checkSkipWriteForFixLengthPart(AbstractPagedOutputView out) throws IOException {
		// skip if there is no enough size.
		int available = out.getSegmentSize() - out.getCurrentPositionInSegment();
		if (available < getSerializedRowFixedPartLength()) {
			out.advance();
			return available;
		}
		return 0;
	}
298784
private int calculateTableSize(Object id, int size) {
        final String methodName = "calculateTableSize()";
        int tableSize = initial_valueset_size;
        boolean finish = false;
        do {
            if (size > tableSize) {
                tableSize = (tableSize * 2) + 1;
            } else {
                float ratio = (float) tableSize / (float) size;
                if (ratio < 1.5) {
                    tableSize = (tableSize * 2) + 1;
                }
                finish = true;
            }
        } while (finish == false);
        if (tc.isDebugEnabled())
            Tr.debug(tc, methodName, "cacheName=" + this.cacheName + " id=" + id + " size=" + size + " tableSize=" + tableSize);
        return tableSize;
    }
708398
function _read(size) {
  /* jshint validthis: true */
  var self = this;
  /**
   * Callback to be called when a READ event is received. Pushes the data onto
   * the read queue and starts reading again if applicable
   * @param {grpc.Event} event READ event object
   */
  function readCallback(err, event) {
    if (err) {
      self.terminate();
      return;
    }
    if (self.finished) {
      self.push(null);
      return;
    }
    var data = event.read;
    var deserialized;
    try {
      deserialized = self.deserialize(data);
    } catch (e) {
      e.code = constants.status.INTERNAL;
      self.emit('error', e);
      return;
    }
    if (self.push(deserialized) && data !== null) {
      var read_batch = {};
      read_batch[grpc.opType.RECV_MESSAGE] = true;
      self.call.startBatch(read_batch, readCallback);
    } else {
      self.reading = false;
    }
  }
  if (self.finished) {
    self.push(null);
  } else {
    if (!self.reading) {
      self.reading = true;
      var batch = {};
      batch[grpc.opType.RECV_MESSAGE] = true;
      self.call.startBatch(batch, readCallback);
    }
  }
}
410301
def size_from_tput
      return unless @output.tty?
      lines = run_command('tput', 'lines').to_i
      cols  = run_command('tput', 'cols').to_i
      [lines, cols] if nonzero_column?(lines)
    rescue IOError, SystemCallError
    end
1293624
public void printMatrixSize(MatrixSize size, MatrixInfo info) {
        format(Locale.ENGLISH, "%10d %10d", size.numRows(), size.numColumns());
        if (info.isCoordinate())
            format(Locale.ENGLISH, " %19d", size.numEntries());
        println();
    }
3943
function(size){
  this.data = [];
  if(typeof size === 'undefined'){
    return; // Empty instance of a bit array
  }
  if(typeof size !== 'number'){
    size = shred(size);
  }
  for(var i=0; i<Math.ceil(size/INTEGER_SIZE); ++i){
    this.data.push(0);
  }
}