// 1 "runtime/context.j" // 1 "" // 1 "" // 31 "" // 1 "/usr/include/stdc-predef.h" 1 3 4 // 32 "" 2 // 1 "runtime/context.j" globals // 1 "runtime/alloc-globals.j" 1 integer JHCR_Context_F = 0 integer array JHCR_Context_V integer JHCR_Context_I = 0 // 6 "runtime/context.j" 2 integer array JHCR_Context_locals integer array JHCR_Context_bindings integer array JHCR_Context_labels integer array JHCR_Context_parent integer array JHCR_Context_pc endglobals // 1 "runtime/alloc.j" 1 function JHCR_Context_alloc takes nothing returns integer local integer JHCR_Context_this = JHCR_Context_F if JHCR_Context_this != 0 then set JHCR_Context_F = JHCR_Context_V[JHCR_Context_this] else set JHCR_Context_I = JHCR_Context_I+1 set JHCR_Context_this = JHCR_Context_I endif if JHCR_Context_this >= JASS_MAX_ARRAY_SIZE then call JHCR_Print_print("no more free instances " + "JHCR_Context__BASE_FILE__") return 0 endif set JHCR_Context_V[JHCR_Context_this] = -1 return JHCR_Context_this endfunction function JHCR_Context_free takes integer JHCR_Context_this returns nothing if JHCR_Context_this == 0 then call JHCR_Print_print("free of nullptr " + "JHCR_Context__BASE_FILE__") return elseif JHCR_Context_V[JHCR_Context_this] != -1 then call JHCR_Print_print("Double free in " + "JHCR_Context__BASE_FILE__") return endif set JHCR_Context_V[JHCR_Context_this] = JHCR_Context_F set JHCR_Context_F = JHCR_Context_this endfunction // 22 "runtime/context.j" 2 function JHCR_Context_destroy takes integer JHCR_Context_ctx returns nothing call JHCR_Table_destroy(JHCR_Context_locals[JHCR_Context_ctx]) call JHCR_Table_destroy(JHCR_Context_bindings[JHCR_Context_ctx]) call JHCR_Context_free(JHCR_Context_ctx) endfunction