add mmap method and test