Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Nov 1994 09:31:50 -0800
From:      Sean Eric Fagan <sef@kithrup.com>
To:        pst@shockwave.com
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/include malloc.h Makefile 
Message-ID:  <199411151731.JAA25818@kithrup.com>
In-Reply-To: <199411151717.JAA02754.kithrup.freebsd.cvs-all@precipice.Shockwave.COM>
References:  Your message of "Tue, 15 Nov 1994 10:10:15 MST." <199411151710.KAA09414@bsd.coe.montana.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help

In article <199411151717.JAA02754.kithrup.freebsd.cvs-all@precipice.Shockwave.COM> you write:
>Yes, indeed.  However, the idea as I understand here is that we're including a
>/usr/include/malloc.h for SystemV compatibility.

<malloc.h> should only be included by programs that intend to use the
various SysVr3 and later libmalloc routines.  In particular, there is the
mallinfo struct and mallinfo().

People who intend to just get a declaration for malloc and company should
include <stdlib.h> in most cases, and <malloc.h> in very, very, very few
cases (!defined(__POSIX_SOURCE) && !defined(__STDC__) || !defined(__GNUC__),
for example).

Include <malloc.h> is going to bite you, because there are programs out
there that, when seeing it, will expect ALL of the functionality to be
there.  It is much easier, in the long run, to just not have it, and include
it in the FAQ, or even in a manual page.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199411151731.JAA25818>