From owner-freebsd-hackers Sat Feb 24 23:45:33 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id DF8D137B401 for ; Sat, 24 Feb 2001 23:45:29 -0800 (PST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.11.1/8.11.1) with ESMTP id f1P7jPd02969; Sun, 25 Feb 2001 00:45:26 -0700 (MST) (envelope-from imp@harmony.village.org) Message-Id: <200102250745.f1P7jPd02969@harmony.village.org> To: seebs@plethora.net (Peter Seebach) Subject: Re: Setting memory allocators for library functions. Cc: freebsd-hackers@FreeBSD.ORG In-reply-to: Your message of "Sat, 24 Feb 2001 15:17:27 CST." <200102242117.f1OLHR619234@guild.plethora.net> References: <200102242117.f1OLHR619234@guild.plethora.net> Date: Sun, 25 Feb 2001 00:45:25 -0700 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <200102242117.f1OLHR619234@guild.plethora.net> Peter Seebach writes: : In message <9631.983048712@critter>, Poul-Henning Kamp writes: : >No it is not and it never was. : : The C committee believes it is. I do not believe you. Such a "believe" does not appear to be embodied in the C-99 standard. The standard (well draft standard) says: 7.20.3.3 The malloc function Synopsis [#1] #include void *malloc(size_t size); Description [#2] The malloc function allocates space for an object whose size is specified by size and whose value is indeterminate. Returns [#3] The malloc function returns either a null pointer or a pointer to the allocated space. Notice that no guarantees about the ability to use all the space, or that it is somehow guaranteed to be there. It just says that that space is allocated. Nothing more and nothing less. I defy you to quote me someting from the standard that is contrary to my position. I searched through the standard extensively to see if "allocates space" is defined and couldn't find anything other than 'the poitner can be used to access the space allocated.' There appear to be no guarantees that you can always use all of the memory that you've allocated, the performance characterstics of accessing said memory or anything else. Do not read too much into the above words. They mean exactly what they say. FreeBSD is in compliance. The space is indeed allocated to the process address space. System resource issues might get in the way of being able to use that, but that's true of anything you allocate. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message