Warning: session_start(): open(/var/lib/php/sessions/sess_ggvvv7c6p4u227pfp598ule82u, 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
sclass RecursiveObjectSize {
long size;
new SimpleStack stack;
Set seen = new CompactIdentityHashSet; // add objects here to ignore them
Set fieldsToIgnore;
Set realmsToIgnore;
swappable void onNewObject(O o) {}
swappable void onSizeChanged() {}
void resize(int expectedObjectCount) {
seen = new CompactIdentityHashSet(expectedObjectCount);
}
void incSize(long n) {
size += n;
onSizeChanged();
}
void recurse(O o) {
if (o == null) ret;
seen.add(o);
stack.add(o);
while ping (nempty(stack))
step(popLast(stack));
}
void step(O o) {
if (guessDeepObjectSize_shouldIgnoreObject(o)) ret;
onNewObject(o);
if (realmsToIgnore != null && contains(realmsToIgnore, getRealm(o))) ret;
ifdef RecursiveObjectSize_debug
print("gos: " + getClassName(o));
endifdef
if (o instanceof Class) ret;
if (isArray(o)) {
int len;
if (o instanceof O[]) {
// len is computed correctly by unsafe_sizeOf
len = unsafe_sizeOf(o);
for (O x : (O[]) o)
if (x != null && seen.add(x)) stack.add(x);
} else
len = inMemorySizeOfPrimitiveArray(o);
size += len;
ret;
}
incSize(unsafe_sizeOf(o));
if (sizeCalculation_shouldSkipObject(o)) ret;
for (Field f : nonStaticNonPrimitiveFieldObjects(o)) {
if (contains(fieldsToIgnore, f)) continue;
O x;
try {
x = f.get(o);
} catch e {
print("Error trying to access " + f + ": " + e);
continue;
}
if (x != null && seen.add(x)) {
stack.add(x);
ifdef RecursiveObjectSize_debug
print("gos field " + f + ": " + getClassName(x));
endifdef
}
}
//fail("can't handle object type: " + className(o));
}
}