replace useless code with clarifying comment
replace malloc/free with mmap/munmap