[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can we make anonymous memory non-EXECUTABLE?


Rob Landley <landley _at_ trommello.org> writes:

> Glibc does mmap instead of brk because theoretically brk can leave wasted 
> memory between fragments, although apparently nobody's ever seen more than 
> 10% waste in a live program, and the speed penality of taking a soft page 
> fault at access time to muck about with the page tables is a LOT bigger than 
> 10%...

The other reason glibc uses mmap() is because your shared libraries
are (usually) mapped smack dab in the middle of your address space.
brk() assumes a contiguous heap, so when it hits your libraries, it
has to stop, even if there is a gig of VM above the libs.  mmap() can
give you an arbitrary chunk of the address space, so glibc uses it for
'large' allocations.

-Doug
-- 
Let us cross over the river, and rest under the shade of the trees.
   --T. J. Jackson, 1863
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo _at_ vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


この情報があなたの探していたものかどうか選択してください。
yes/まさにこれだ!   no/違うなぁ   part/一部見つかった   try/これで試してみる

あなたが探していた情報はどのようなことか、ご自由に記入下さい。特に「まさにこれだ!」と言う場合は記入をお願いします。
例:「複数のマシンからCATV経由でipmasqueradeを利用してWebを参照したい場合の設定について」
References: