functions order when do memory mapping



A:
open
mmap
munmap
close

or

B:
open
mmap
close
munmap

Both works well, I wonder which is better?
.