RosettaCodeData/Task/Arena-storage-pool/Phix/arena-storage-pool-2.phix
2026-02-01 16:33:20 -08:00

13 lines
324 B
Text

without js
sequence ap = {}
function ap_allocate(integer size)
-- allocate some memory and add it to the arena pool 'ap' for later release
atom res = allocate(size)
ap = append(ap,res)
return res
end function
procedure ap_free()
-- free all memory allocated in arena pool 'ap'
free(ap)
ap = {}
end procedure