Warning: session_start(): open(/var/lib/php/sessions/sess_ej91k9c5sg2veupst2gfr6dp7k, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
// stores all strings as UTF8 (typically half as big)
static class CondensedStrings2 extends AbstractList {
byte[] data;
int[] indices;
*() {} // only for serialisation
*(L l) {
long totalLength = 0;
for (S s : l) totalLength += l(toUtf8(s));
int len = (int) totalLength;
if (len != totalLength) fail("TOO BIG!!!!!! " + totalLength);
data = new byte[len];
int n = l(l);
indices = new int[n];
int idx = 0;
for (int i = 0; i < n; i++) {
S s = l.get(i);
try {
byte[] x = toUtf8(s);
System.arraycopy(x, 0, data, idx, l(x));
indices[i] = idx;
idx += l(x);
} catch (RuntimeException e) {
print("idx=" + idx + ", s=" + s + ", i=" + i +", n=" + n + ", len=" + len);
throw e;
}
}
}
public S get(int i) ctex {
int idx1 = indices[i];
int idx2 = i+1 < indices.length ? indices[i+1] : data.length;
ret new String(data, idx1, idx2-idx1, "UTF8");
}
public int size() {
ret indices.length;
}
int totalSize() {
ret data.length;
}
}