Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jul 1998 00:20:55 -0400 (EDT)
From:      robert@cyrus.watson.org
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   docs/7138: man 9 malloc example inconsistent with prototype
Message-ID:  <199807010420.AAA03312@trojanhorse.watson.org>

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

>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:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul  1 07:00:01 PDT 1998
>Last-Modified:
>Originator:     Robert Watson
>Organization:
>Release:        FreeBSD 3.0-CURRENT i386
>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..
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message



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