Date: Tue, 22 Oct 2002 12:50:28 +0100 From: Tony Finch <dot@dotat.at> To: tlambert2@mindspring.com Cc: hackers@freebsd.org Subject: Re: malloc Message-ID: <E183xYK-0003aB-00@chiark.greenend.org.uk> In-Reply-To: <3DB50A5A.F87EDA78@mindspring.com> References: <E183u5Y-0003Yc-00@cse.cs.huji.ac.il>
next in thread | previous in thread | raw e-mail | index | archive | help
Terry Lambert <tlambert2@mindspring.com> wrote: > >The FreeBSD malloc guarantees that the pages are zeroed before being >obtained from the system; this is probably the majority of the cost. >It is a security measure, so that you do not leak data from one process >to another through anonymous pages. > >The Linux malloc does not. Utter bollocks. FreeBSD malloc can be configured to re-initialize memory on every allocation, but this is designed to assist with buggy programs, it is *not* a security measure. Memory obtained from the kernel on *all* unices (including Linux) is zeroed; that is when security matters, not in malloc. This will not affect the relative performance of phk and gnu malloc. >The FreeBSD malloc references an environment variable and a readlink() >of a potentially non-existant symbolic link containing configuration >data for the malloc. Once at program startup. This is not a significant cost. >The FreeBSD allocation is an overcommit allocation True for Linux too, by default. Tony. -- f.a.n.finch <dot@dotat.at> http://dotat.at/ NORTH UTSIRE: EAST 4 OR 5 INCREASING 6 TO GALE 8. RAIN. MODERATE. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E183xYK-0003aB-00>