Date: Sun, 25 Feb 2001 00:45:25 -0700 From: Warner Losh <imp@harmony.village.org> To: seebs@plethora.net (Peter Seebach) Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Setting memory allocators for library functions. Message-ID: <200102250745.f1P7jPd02969@harmony.village.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>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <stdlib.h> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102250745.f1P7jPd02969>