diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2008-10-23 15:53:51 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2008-10-23 15:53:51 +0000 |
commit | 1ede983cc905643549d8cae56a9d0e28fc68375f (patch) | |
tree | 21e792ce590e1bcf9b343890605a1b4c6a9016b3 /share/man | |
parent | 994f9863852fe65833509090659d9f5aef7194d3 (diff) | |
download | src-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')
-rw-r--r-- | share/man/man9/Makefile | 4 | ||||
-rw-r--r-- | share/man/man9/malloc.9 | 22 |
2 files changed, 3 insertions, 23 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 2705b6b36b83..84970aad24f4 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -741,9 +741,7 @@ MLINKS+=LOCK_PROFILING.9 MUTEX_PROFILING.9 MLINKS+=make_dev.9 destroy_dev.9 \ make_dev.9 dev_depends.9 \ make_dev.9 make_dev_alias.9 -MLINKS+=malloc.9 FREE.9 \ - malloc.9 free.9 \ - malloc.9 MALLOC.9 \ +MLINKS+=malloc.9 free.9 \ malloc.9 MALLOC_DECLARE.9 \ malloc.9 MALLOC_DEFINE.9 \ malloc.9 realloc.9 \ 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 |