Added simple mmap function and modified alloc with mmap
separate spmlib into spm.c and spmlib.c