From robert@trojanhorse.watson.org  Wed Jul  1 07:00:11 1998
Received: from relay.hq.tis.com (relay.hq.tis.com [192.94.214.100])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA19927
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 1 Jul 1998 07:00:09 -0700 (PDT)
          (envelope-from robert@trojanhorse.watson.org)
Received: by relay.hq.tis.com; id JAA24993; Wed, 1 Jul 1998 09:55:55 -0400 (EDT)
Received: from unknown(10.33.40.29) by relay.hq.tis.com via smap (4.0a)
	id xma024938; Wed, 1 Jul 98 09:55:19 -0400
Received: (from robert@localhost)
	by trojanhorse.watson.org (8.8.8/8.8.8) id AAA03312;
	Wed, 1 Jul 1998 00:20:55 -0400 (EDT)
	(envelope-from robert)
Message-Id: <199807010420.AAA03312@trojanhorse.watson.org>
Date: Wed, 1 Jul 1998 00:20:55 -0400 (EDT)
From: robert@cyrus.watson.org
Reply-To: robert+freebsd@cyrus.watson.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: man 9 malloc example inconsistent with prototype
X-Send-Pr-Version: 3.2

>Number:         7138
>Category:       docs
>Synopsis:       man 9 malloc has incorrect example for MALLOC macro
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul  1 07:00:01 PDT 1998
>Closed-Date:    Wed Jul 1 22:37:40 PDT 1998
>Last-Modified:  Wed Jul  1 22:37:57 PDT 1998
>Originator:     Robert Watson
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:
FreeBSD current


>Description:

man 9 MALLOC reports the following:

...
     MALLOC(space, cast, unsigned long size, struct malloc_type *type,
             int flags)
...

But later in sample code:

           MALLOC(buf, sizeof *buf, struct foo_buf *, M_FOOBUF, M_NOWAIT);

The sizeof *bug and struct foo_buf arguments are reversed.

>How-To-Repeat:


>Fix:
	
replace with:

	MALLOC(bug, struct foo_buf *, sizeof *buf, M_FOOBAR, M_NOWAIT);

Thanks..
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Wed Jul 1 22:37:40 PDT 1998 
State-Changed-Why:  
fixed in -current, thanks! 
>Unformatted:
