private void rehash() {
        capacity = (capacity << 1);
        Value[] v = values;
        values = new Value[capacity];
        System.arraycopy(v, 0, values, 0, used);
        int[] h = hash;
        hash = new int[capacity + hashSize() + (capacity << 1)];
        System.arraycopy(h, 0, hash, 0, used);
        for (int i = 0; i < used; i++) {
            int prev = (capacity + (hash[i] % hashSize()));
            int entry = hash[prev];
            while (entry != 0) {
                prev = entry + 1;
                entry = hash[prev];
            }
            final int insertIdx = (capacity + hashSize() + (i << 1));
            hash[prev] = insertIdx;
            hash[insertIdx] = i;
        }
    }
A Value holding a slime "Object", a dynamic collection of named
value fields.  Fields can be inspected or traversed using the
{@link Inspector} interface, and you can add new fields by using the
various "set" methods in the @ref Cursor interface.

@author havardpe
vespajlib/src/main/java/com/yahoo/slime/ObjectValue.java