Expand the underlying byte buffer to contain the specified delta
@param delta amount needed to accommodate the next buffer append
503920
private void ensureCapacity(int delta) {
        ByteBuffer bb = m_container.b();
        int bufferDelta = (bb.position() + delta) - bb.capacity();
        if (bufferDelta > 0) {
            BBContainer ncntnr = DBBPool.allocateUnsafeByteBuffer(bb.capacity() + bufferDelta);

            ByteBuffer newbb = ncntnr.b();
            bb.flip();
            newbb.put(bb);

            m_container.discard();
            m_container = ncntnr;
        }
    }
1355088
public void update(int delta) {
		emitter.updateParticle(this, delta);
		life -= delta;
		
		if (life > 0) {
			x += delta * velx;
			y += delta * vely;
		} else {
			engine.release(this);
		}
	}
243317
public BigInteger addAndGet(BigInteger delta) {
        for (;;) {
        	BigInteger current = valueHolder.get();
        	BigInteger next = current.add(delta);
            if (valueHolder.compareAndSet(current, next))
                return next;
        }
    }
5416
synchronized void increaseLength(long delta) {
        Preconditions.checkState(!this.sealed, "Cannot increase the length of a sealed SegmentChunk.");
        Preconditions.checkArgument(delta >= 0, "Cannot decrease the length of a SegmentChunk.");
        this.length += delta;
    }
636431
private void expandBuffers() {
    if (this.serialized.length < size + ARC_SIZE * MAX_LABELS) {
      serialized = java.util.Arrays.copyOf(serialized, serialized.length + bufferGrowthSize);
      serializationBufferReallocations++;
    }
  }
1192749
public void update(float delta) {
        background.update(delta);
        focusedBackground.update(delta);
        leftBorder.update(delta);
        rightBorder.update(delta);
        topBorder.update(delta);
        bottomBorder.update(delta);
        for (Widget child : children) {
            child.update(delta);
        }
    }
674317
public void shrink(int delta) {
        if (delta <= 0) {
            return;
        }

        int newLimit = buffer.limit() - delta;
        if (newLimit <= 0) {
            newLimit = 0;
        }
        this.buffer.limit(newLimit);
    }
1028780
public void addByte(int b)
    throws IOException
  {
    int nextHead = (_byteHead + 1) % _byteBuffer.length;

    while (nextHead == _byteTail) {
      int ch = readChar();

      if (ch < 0) {
        break;
      }

      outputChar(ch);
    }

    _byteBuffer[_byteHead] = (byte) b;
    _byteHead = nextHead;
  }
1356847
public void update(ByteBuffer buffer) {
    length += buffer.remaining();
    //Save current position to leave given buffer unchanged
    int position = buffer.position();
    
    //Complete the final buffer if needed
    completeFinalBuffer(buffer);
    
    while(buffer.remaining() >= 64) {
      transform(buffer);
    }
    
    if(buffer.remaining() != 0) {
      finalBuffer.put(buffer);
    }
    
    buffer.position(position);
  }
1126191
void appendCompressed(ByteData compressed, ByteData original)
        throws IOException
    {
        mCompressedSegments++;
        mBuffer.appendSurrogate(new CompressedData(compressed, original));
    }
678984
public void updateNodeChangedSize(String nodePath, long delta)
   {
      Long oldDelta = calculatedChangedNodesSize.get(nodePath);
      Long newDelta = delta + (oldDelta != null ? oldDelta : 0);

      calculatedChangedNodesSize.put(nodePath, newDelta);
   }
558956
public void add(int deltaHi, int deltaLo) {
        while (true) {
            long encoded = get();
            long update = encode(getHi(encoded) + deltaHi, getLo(encoded) + deltaLo);
            if (compareAndSet(encoded, update))
                return;
        }
    }
175234
void increase() {
        // double the size
        length <<= 1;
        // There is no need to preserve what was in the memory before.
        ByteBuffer buffer = Buffer.allocateDirectWithNativeOrder(calculateBufferCapacity(length));
        Buffer.free(memory);
        memory = buffer;
        memoryAddress = Buffer.memoryAddress(buffer);
    }
1317506
public void append(final int b) {
        final int newlen = this.len + 1;
        if (newlen > this.array.length) {
            expand(newlen);
        }
        this.array[this.len] = (byte)b;
        this.len = newlen;
    }
1178287
public long addAndGet(K key, long delta) {
    outer: for (;;) {
      AtomicLong atomic = map.get(key);
      if (atomic == null) {
        atomic = map.putIfAbsent(key, new AtomicLong(delta));
        if (atomic == null) {
          return delta;
        }
        // atomic is now non-null; fall through
      }

      for (;;) {
        long oldValue = atomic.get();
        if (oldValue == 0L) {
          // don't compareAndSet a zero
          if (map.replace(key, atomic, new AtomicLong(delta))) {
            return delta;
          }
          // atomic replaced
          continue outer;
        }

        long newValue = oldValue + delta;
        if (atomic.compareAndSet(oldValue, newValue)) {
          return newValue;
        }
        // value changed
      }
    }
  }
1343200
public BigInteger getAndAdd(BigInteger delta) {
        while (true) {
        	BigInteger current = get();
        	BigInteger next = current.add(delta);
            if (compareAndSet(current, next))
                return current;
        }
    }
857109
private void expandBuffer(int newBufferSize)
    {
        // Allocate a new buffer.
        ByteBuffer newBuffer = ByteBuffer.allocate(newBufferSize);

        // Copy the content of the current buffer to the new buffer.
        int oldPosition = mBuffer.position();
        mBuffer.position(0);
        newBuffer.put(mBuffer);
        newBuffer.position(oldPosition);

        // Replace the buffers.
        mBuffer = newBuffer;
    }