string test_s186 array T_nextFree178 integer T_firstFree160 integer T_maxIndex192 array T_typeId556 string test_s186 = "" integer T_firstFree160 = 0 integer T_maxIndex192 = 0 function initGlobals189() { T_firstFree_160 = 0; T_maxIndex_192 = 0; } function main121() { initGlobals189(); init_test131(); } function config340() { } function init_test131() { local integer t126 test_s_186 = ""; t_126 = new_A216(); dispatch_T_destroyT146(t_126); if (test_s_186 == "") { testSuccess149(); } else { }; } IS_NATIVE function testSuccess149() { } function A_init953(integer this164) { } function new_A216() returns integer { local integer this162 this_162 = alloc_A426(); construct_A125(this_162); return this_162; } function construct_A125(integer this470) { A_init953(this_470); } function A_onDestroy175(integer this122) { } function destroyA103(integer this124) { A_onDestroy175(this_124); dealloc_A164(this_124); } function B_onDestroy690(integer this167) { test_s_186 = (test_s_186 + "B"); } function destroyB145(integer this118) { B_onDestroy690(this_118); dealloc_B998(this_118); } function destroyT928(integer this106) { dealloc_T126(this_106); } function alloc_A426() returns integer { local integer this105 if (T_firstFree_160 == 0) { if (T_maxIndex_192 < 32768) { T_maxIndex_192 = (T_maxIndex_192 + 1); this_105 = T_maxIndex_192; T_typeId_556[this_105] = 2; } else { error148("Out of memory: Could not create A."); this_105 = 0; }; } else { T_firstFree_160 = (T_firstFree_160 - 1); this_105 = T_nextFree_178[T_firstFree_160]; T_typeId_556[this_105] = 2; }; return this_105; } function error148(string msg312) { $debugPrint209((msg_312 + (" " + #getStackTrace()))); } function dealloc_A164(integer obj644) { if (T_typeId_556[obj_644] == 0) { error148("Double free: object of type A"); } else { T_nextFree_178[T_firstFree_160] = obj_644; T_firstFree_160 = (T_firstFree_160 + 1); T_typeId_556[obj_644] = 0; }; } function dealloc_B998(integer obj203) { if (T_typeId_556[obj_203] == 0) { error148("Double free: object of type B"); } else { T_nextFree_178[T_firstFree_160] = obj_203; T_firstFree_160 = (T_firstFree_160 + 1); T_typeId_556[obj_203] = 0; }; } function dealloc_T126(integer obj140) { if (T_typeId_556[obj_140] == 0) { error148("Double free: object of type T"); } else { T_nextFree_178[T_firstFree_160] = obj_140; T_firstFree_160 = (T_firstFree_160 + 1); T_typeId_556[obj_140] = 0; }; } function dispatch_T_destroyT146(integer this398) { if (T_typeId_556[this_398] == 0) { if (this_398 == 0) { error148("Nullpointer exception when calling T.T"); } else { error148("Called T.T on invalid object."); }; } else { }; if (T_typeId_556[this_398] <= 2) { if (T_typeId_556[this_398] <= 1) { destroyT928(this_398); } else { destroyA103(this_398); }; } else { destroyB145(this_398); }; }