summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/malloc.3
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2008-05-19 19:36:15 +0000
committerotto <otto@openbsd.org>2008-05-19 19:36:15 +0000
commit010dd593af160c00466cb4be81afd918ac182c8b (patch)
treefeae8a9170716dcb74689a3da0aa5fb3ed05207b /lib/libc/stdlib/malloc.3
parentAdd support for TSEC interrupts. (diff)
downloadwireguard-openbsd-010dd593af160c00466cb4be81afd918ac182c8b.tar.xz
wireguard-openbsd-010dd593af160c00466cb4be81afd918ac182c8b.zip
remove recalloc(3); it is buggy and impossible to repair without big
costs; ok jmc@ for the man page bits; ok millert@ deraadt@
Diffstat (limited to 'lib/libc/stdlib/malloc.3')
-rw-r--r--lib/libc/stdlib/malloc.328
1 files changed, 3 insertions, 25 deletions
diff --git a/lib/libc/stdlib/malloc.3 b/lib/libc/stdlib/malloc.3
index e82dc45842d..1b481933cae 100644
--- a/lib/libc/stdlib/malloc.3
+++ b/lib/libc/stdlib/malloc.3
@@ -30,16 +30,15 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: malloc.3,v 1.50 2007/09/05 06:03:08 deraadt Exp $
+.\" $OpenBSD: malloc.3,v 1.51 2008/05/19 19:36:15 otto Exp $
.\"
-.Dd $Mdocdate: September 5 2007 $
+.Dd $Mdocdate: May 19 2008 $
.Dt MALLOC 3
.Os
.Sh NAME
.Nm malloc ,
.Nm calloc ,
.Nm realloc ,
-.Nm recalloc ,
.Nm free ,
.Nm cfree
.Nd memory allocation and deallocation
@@ -51,8 +50,6 @@
.Fn calloc "size_t nmemb" "size_t size"
.Ft void *
.Fn realloc "void *ptr" "size_t size"
-.Ft void *
-.Fn recalloc "void *ptr" "size_t nmemb" "size_t size"
.Ft void
.Fn free "void *ptr"
.Ft void
@@ -206,18 +203,7 @@ if ((newp = realloc(p, num * size)) == NULL) {
...
.Ed
.Pp
-The
-.Fn recalloc
-function is similar to
-.Fn realloc
-except that it shares semantics with
-.Fn calloc
-rather than
-.Fn malloc .
-Newly allocated space is initialized to zero and the resulting size is
-checked for integer overflow.
-.Pp
-These functions will first look for a symbolic link called
+Malloc will first look for a symbolic link called
.Pa /etc/malloc.conf
and next check the environment for a variable called
.Ev MALLOC_OPTIONS
@@ -272,8 +258,6 @@ sizeof(ptr) errors where sizeof(*ptr) is meant.
.Dq realloc .
Always reallocate when
.Fn realloc
-or
-.Fn recalloc
is called, even if the initial allocation was big enough.
This can substantially aid in compacting memory.
.\".Pp
@@ -458,12 +442,6 @@ The
.Fn malloc
function conforms to
.St -ansiC .
-.Pp
-The
-.Fn recalloc
-function is an
-.Ox
-extension.
.Sh HISTORY
The present implementation of
.Fn malloc