Browse Source

Document it.

OPENBSD_2_0
downsj 28 years ago
parent
commit
496f69a002
2 changed files with 14 additions and 4 deletions
  1. +2
    -2
      src/lib/libc/stdlib/Makefile.inc
  2. +12
    -2
      src/lib/libc/stdlib/malloc.3

+ 2
- 2
src/lib/libc/stdlib/Makefile.inc View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile.inc,v 1.3 1996/08/10 04:18:48 tholo Exp $
# $OpenBSD: Makefile.inc,v 1.4 1996/08/21 03:12:17 downsj Exp $
# stdlib sources
.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/stdlib ${.CURDIR}/stdlib
@ -37,7 +37,7 @@ MAN+= abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 bsearch.3 \
random.3 realpath.3 strtod.3 strtol.3 strtoul.3 system.3
MLINKS+=getenv.3 setenv.3 getenv.3 unsetenv.3 getenv.3 putenv.3
MLINKS+=malloc.3 free.3 malloc.3 realloc.3
MLINKS+=malloc.3 free.3 malloc.3 realloc.3 cfree.3
MLINKS+=qsort.3 heapsort.3 qsort.3 mergesort.3
MLINKS+=rand.3 srand.3
MLINKS+=random.3 initstate.3 random.3 setstate.3 random.3 srandom.3


+ 12
- 2
src/lib/libc/stdlib/malloc.3 View File

@ -33,7 +33,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $OpenBSD: malloc.3,v 1.2 1996/08/10 04:18:49 tholo Exp $
.\" $OpenBSD: malloc.3,v 1.3 1996/08/21 03:12:18 downsj Exp $
.\"
.Dd June 4, 1993
.Dt MALLOC 3
@ -42,7 +42,8 @@
.Nm malloc ,
.Nd general memory allocation function
.Pp
.Nm free
.Nm free ,
.Nm cfree
.Nd free up memory allocated with malloc, calloc or realloc
.Pp
.Nm realloc
@ -53,6 +54,8 @@
.Fn malloc "size_t size"
.Ft void
.Fn free "void *ptr"
.Ft void
.Fn cfree "void *ptr"
.Ft void *
.Fn realloc "void *ptr" "size_t size"
.Sh DESCRIPTION
@ -83,6 +86,13 @@ If
.Fa ptr
is a null pointer, no action occurs.
.Pp
A
.Fn cfree
function is also provided for compatibility with old systems and other
.Nm malloc
libraries; it is simply an alias for
.Fn free .
.Pp
The
.Fn realloc
function changes the size of the object pointed to by


Loading…
Cancel
Save