array C_nextFree176 integer C_firstFree534 integer C_maxIndex212 array C_typeId566 integer C_firstFree534 = 0 integer C_maxIndex212 = 0 function initGlobals122() { C_firstFree_534 = 0; C_maxIndex_212 = 0; } function main300() { initGlobals122(); init_test785(); } function config196() { } function init_test785() { local integer a205 local integer b888 a_205 = new_C432(); dispatch_C_destroyC287(a_205); a_205 = new_C432(); dispatch_C_destroyC287(a_205); a_205 = new_C432(); b_888 = new_C432(); if (a_205 != b_888) { testSuccess464(); } else { }; } IS_NATIVE function testSuccess464() { } function C_init193(integer this190) { } function new_C432() returns integer { local integer this128 this_128 = alloc_C197(); construct_C244(this_128); return this_128; } function construct_C244(integer this127) { C_init193(this_127); } function C_onDestroy174(integer this241) { } function destroyC192(integer this715) { C_onDestroy174(this_715); dealloc_C244(this_715); } function alloc_C197() returns integer { local integer this209 if (C_firstFree_534 == 0) { if (C_maxIndex_212 < 32768) { C_maxIndex_212 = (C_maxIndex_212 + 1); this_209 = C_maxIndex_212; C_typeId_566[this_209] = 1; } else { error132("Out of memory: Could not create C."); this_209 = 0; }; } else { C_firstFree_534 = (C_firstFree_534 - 1); this_209 = C_nextFree_176[C_firstFree_534]; C_typeId_566[this_209] = 1; }; return this_209; } function error132(string msg907) { $debugPrint616((msg_907 + (" " + #getStackTrace()))); } function dealloc_C244(integer obj116) { if (C_typeId_566[obj_116] == 0) { error132("Double free: object of type C"); } else { C_nextFree_176[C_firstFree_534] = obj_116; C_firstFree_534 = (C_firstFree_534 + 1); C_typeId_566[obj_116] = 0; }; } function dispatch_C_destroyC287(integer this511) { if (C_typeId_566[this_511] == 0) { if (this_511 == 0) { error132("Nullpointer exception when calling C.C"); } else { error132("Called C.C on invalid object."); }; } else { }; destroyC192(this_511); }