array C_nextFree329 integer C_firstFree118 integer C_maxIndex646 array C_typeId144 integer C_firstFree118 = 0 integer C_maxIndex646 = 0 function initGlobals104() { } function main172() { initGlobals104(); init_test124(); } function config162() { } function init_test124() { local integer a438 a_438 = new_C169(); dispatch_C_destroyC205(a_438); a_438 = new_C169(); dispatch_C_destroyC205(a_438); a_438 = new_C169(); if (a_438 != new_C169()) { testSuccess756(); } else { }; } IS_NATIVE function testSuccess756() { } function C_init109(integer this207) { } function new_C169() returns integer { local integer this195 this_195 = alloc_C140(); construct_C521(this_195); return this_195; } function construct_C521(integer this733) { C_init109(this_733); } function C_onDestroy124(integer this164) { } function destroyC126(integer this827) { C_onDestroy124(this_827); dealloc_C214(this_827); } function alloc_C140() returns integer { local integer this687 if (C_firstFree_118 == 0) { if (C_maxIndex_646 < 32768) { C_maxIndex_646 = (C_maxIndex_646 + 1); this_687 = C_maxIndex_646; C_typeId_144[this_687] = 1; } else { error153("Out of memory: Could not create C."); this_687 = 0; }; } else { C_firstFree_118 = (C_firstFree_118 - 1); this_687 = C_nextFree_329[C_firstFree_118]; C_typeId_144[this_687] = 1; }; return this_687; } function error153(string msg123) { $debugPrint195((msg_123 + (" " + #getStackTrace()))); } function dealloc_C214(integer obj879) { if (C_typeId_144[obj_879] == 0) { error153("Double free: object of type C"); } else { C_nextFree_329[C_firstFree_118] = obj_879; C_firstFree_118 = (C_firstFree_118 + 1); C_typeId_144[obj_879] = 0; }; } function dispatch_C_destroyC205(integer this955) { if (C_typeId_144[this_955] == 0) { if (this_955 == 0) { error153("Nullpointer exception when calling C.C"); } else { error153("Called C.C on invalid object."); }; } else { }; destroyC126(this_955); }