// 1 "runtime/list.j" // 1 "" // 1 "" // 31 "" // 1 "/usr/include/stdc-predef.h" 1 3 4 // 32 "" 2 // 1 "runtime/list.j" globals // 1 "runtime/alloc-globals.j" 1 integer JHCR_List_F = 0 integer array JHCR_List_V integer JHCR_List_I = 0 // 6 "runtime/list.j" 2 integer array JHCR_List_next endglobals // 1 "runtime/alloc.j" 1 function JHCR_List_alloc takes nothing returns integer local integer JHCR_List_this = JHCR_List_F if JHCR_List_this != 0 then set JHCR_List_F = JHCR_List_V[JHCR_List_this] else set JHCR_List_I = JHCR_List_I+1 set JHCR_List_this = JHCR_List_I endif if JHCR_List_this >= JASS_MAX_ARRAY_SIZE then call JHCR_Print_print("no more free instances " + "JHCR_List__BASE_FILE__") return 0 endif set JHCR_List_V[JHCR_List_this] = -1 return JHCR_List_this endfunction function JHCR_List_free takes integer JHCR_List_this returns nothing if JHCR_List_this == 0 then call JHCR_Print_print("free of nullptr " + "JHCR_List__BASE_FILE__") return elseif JHCR_List_V[JHCR_List_this] != -1 then call JHCR_Print_print("Double free in " + "JHCR_List__BASE_FILE__") return endif set JHCR_List_V[JHCR_List_this] = JHCR_List_F set JHCR_List_F = JHCR_List_this endfunction // 12 "runtime/list.j" 2 function JHCR_List_cons takes integer JHCR_List_tl returns integer local integer JHCR_List_new = JHCR_List_alloc() set JHCR_List_next[JHCR_List_new] = JHCR_List_tl return JHCR_List_new endfunction function JHCR_List_destroy takes integer JHCR_List_l returns nothing loop exitwhen JHCR_List_l == 0 call JHCR_List_free(JHCR_List_l) set JHCR_List_l = JHCR_List_next[JHCR_List_l] endloop endfunction