Alex Rivera | Logout

Why does munmap needs a length as parameter?

Asked 2012-08-22T15:17:45.153
12

I was wondering, why should the size of mapped memory being one parameter passed in, since there couldn't more more than one mapping starting from same address (could they ?), why won't linux kernel record both start address, length together, but let userspace program remember them.

I mean, why wouldn't it be, just use the start address as primary key to store the information tree.

Edit
Report

1 Answer

11

One can map, say, 5 pages and later unmap one of them. And information about what pages to unmap is passed as address and length where the length is a multiple of page size.

answered 2012-08-22T15:28:06.873

Your Answer