string test_s133 array T_nextFree202 integer T_firstFree422 integer T_maxIndex211 array T_typeId154 string test_s133 = "" integer T_firstFree422 = 0 integer T_maxIndex211 = 0 function initGlobals182() { } function main212() { initGlobals182(); init_test210(); } function config213() { } function init_test210() { test_s_133 = ""; dispatch_T_destroyT200(new_A569()); if (test_s_133 == "") { testSuccess159(); } else { }; } IS_NATIVE function testSuccess159() { } function A_init949(integer this171) { } function new_A569() returns integer { local integer this464 this_464 = alloc_A138(); construct_A181(this_464); return this_464; } function construct_A181(integer this413) { A_init949(this_413); } function A_onDestroy427(integer this429) { } function destroyA180(integer this666) { A_onDestroy427(this_666); dealloc_A138(this_666); } function B_onDestroy203(integer this214) { test_s_133 = (test_s_133 + "B"); } function destroyB696(integer this136) { B_onDestroy203(this_136); dealloc_B210(this_136); } function destroyT125(integer this282) { dealloc_T117(this_282); } function alloc_A138() returns integer { local integer this171 if (T_firstFree_422 == 0) { if (T_maxIndex_211 < 32768) { T_maxIndex_211 = (T_maxIndex_211 + 1); this_171 = T_maxIndex_211; T_typeId_154[this_171] = 2; } else { error929("Out of memory: Could not create A."); this_171 = 0; }; } else { T_firstFree_422 = (T_firstFree_422 - 1); this_171 = T_nextFree_202[T_firstFree_422]; T_typeId_154[this_171] = 2; }; return this_171; } function error929(string msg375) { $debugPrint348((msg_375 + (" " + #getStackTrace()))); } function dealloc_A138(integer obj100) { if (T_typeId_154[obj_100] == 0) { error929("Double free: object of type A"); } else { T_nextFree_202[T_firstFree_422] = obj_100; T_firstFree_422 = (T_firstFree_422 + 1); T_typeId_154[obj_100] = 0; }; } function dealloc_B210(integer obj134) { if (T_typeId_154[obj_134] == 0) { error929("Double free: object of type B"); } else { T_nextFree_202[T_firstFree_422] = obj_134; T_firstFree_422 = (T_firstFree_422 + 1); T_typeId_154[obj_134] = 0; }; } function dealloc_T117(integer obj208) { if (T_typeId_154[obj_208] == 0) { error929("Double free: object of type T"); } else { T_nextFree_202[T_firstFree_422] = obj_208; T_firstFree_422 = (T_firstFree_422 + 1); T_typeId_154[obj_208] = 0; }; } function dispatch_T_destroyT200(integer this161) { if (T_typeId_154[this_161] == 0) { if (this_161 == 0) { error929("Nullpointer exception when calling T.T"); } else { error929("Called T.T on invalid object."); }; } else { }; if (T_typeId_154[this_161] <= 2) { if (T_typeId_154[this_161] <= 1) { destroyT125(this_161); } else { destroyA180(this_161); }; } else { destroyB696(this_161); }; }