How does posix_memalign with alignment size of 4096 bytes differ from mmap? Does it internally use mmap or some other mechanism?
How does posix_memalign with alignment size of 4096 bytes differ from mmap ? Does
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
posix_memalignis a higher-level API thanmmap, designed to interoperate withmalloc,freeandrealloc.mmapusage is more complicated because it offers more functionality thanposix_memalign(mapping files into a process’s address space). How it is implemented (in terms ofmmapor otherwise) is left unspecified by the POSIX standard.Use
posix_memalignwhere you’d usemallocif you didn’t have alignment restrictions.