add boundary conditions judge for mmap and chunk