aboutsummaryrefslogtreecommitdiff
path: root/share/man/man9/malloc.9
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2008-10-23 15:53:51 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2008-10-23 15:53:51 +0000
commit1ede983cc905643549d8cae56a9d0e28fc68375f (patch)
tree21e792ce590e1bcf9b343890605a1b4c6a9016b3 /share/man/man9/malloc.9
parent994f9863852fe65833509090659d9f5aef7194d3 (diff)
downloadsrc-1ede983cc905643549d8cae56a9d0e28fc68375f.tar.gz
src-1ede983cc905643549d8cae56a9d0e28fc68375f.zip
Retire the MALLOC and FREE macros. They are an abomination unto style(9).
MFC after: 3 months
Notes
Notes: svn path=/head/; revision=184205
Diffstat (limited to 'share/man/man9/malloc.9')
-rw-r--r--share/man/man9/malloc.922
1 files changed, 2 insertions, 20 deletions
diff --git a/share/man/man9/malloc.9 b/share/man/man9/malloc.9
index 1061266cef64..76aa83ab4a67 100644
--- a/share/man/man9/malloc.9
+++ b/share/man/man9/malloc.9
@@ -36,14 +36,12 @@
.\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $
.\" $FreeBSD$
.\"
-.Dd June 12, 2003
+.Dd October 23, 2008
.Dt MALLOC 9
.Os
.Sh NAME
.Nm malloc ,
-.Nm MALLOC ,
.Nm free ,
-.Nm FREE ,
.Nm realloc ,
.Nm reallocf ,
.Nm MALLOC_DEFINE ,
@@ -54,10 +52,8 @@
.In sys/malloc.h
.Ft void *
.Fn malloc "unsigned long size" "struct malloc_type *type" "int flags"
-.Fn MALLOC space cast "unsigned long size" "struct malloc_type *type" "int flags"
.Ft void
.Fn free "void *addr" "struct malloc_type *type"
-.Fn FREE "void *addr" "struct malloc_type *type"
.Ft void *
.Fn realloc "void *addr" "unsigned long size" "struct malloc_type *type" "int flags"
.Ft void *
@@ -123,20 +119,6 @@ function is identical to
except that it
will free the passed pointer when the requested memory cannot be allocated.
.Pp
-The
-.Fn MALLOC
-macro variant is functionally equivalent to
-.Bd -literal -offset indent
-(space) = (cast)malloc((u_long)(size), type, flags)
-.Ed
-.Pp
-and the
-.Fn FREE
-macro variant is equivalent to
-.Bd -literal -offset indent
-free((addr), type)
-.Ed
-.Pp
Unlike its standard C library counterpart
.Pq Xr malloc 3 ,
the kernel version takes two more arguments.
@@ -219,7 +201,7 @@ MALLOC_DEFINE(M_FOOBUF, "foobuffers", "Buffers to foo data into the ether");
/* sys/something/foo_subr.c */
\&...
-MALLOC(buf, struct foo_buf *, sizeof *buf, M_FOOBUF, M_NOWAIT);
+buf = malloc(sizeof *buf, M_FOOBUF, M_NOWAIT);
.Ed
.Pp