At the beginning of my program I allocate memory using HeapAlloc. Is it neccessary to deallocate it or is that done by the system, when the program ends?
start:
call GetProcessHeap
mov r11, rax ; r11 contains handle
mov rdi, 8000000
mov rsi, 0
mov rdx, r11
call HeapAlloc
mov r12, rax ; r12 contains pointer to memory block
mov ecx, 1000000
xor eax, eax
.looptop_populate
add rax, rcx
mov [r12+8*rcx-8], rax
loop .looptop_populate
mov rdi, [r12]
call write_uinteger
xor eax, eax
ret
; goasm /x64 /l malloc
; golink /console malloc.obj kernel32.dll
At the moment the memory seems to be deallocated automatically, but it is good style to just ignore the deallocation?