date and time created 93/05/24 10:58:50 by bostic
[unix-history] / usr / src / lib / libc / gen / valloc.3
CommitLineData
ae59e04c
CL
1.\" Copyright (c) 1980, 1991 Regents of the University of California.
2.\" All rights reserved.
09c5700e 3.\"
ae59e04c 4.\" %sccs.include.redist.man%
09c5700e 5.\"
ae59e04c
CL
6.\" @(#)valloc.3 6.3 (Berkeley) %G%
7.\"
8.Dd
9.Dt VALLOC 3
10.Os BSD 3
11.Sh NAME
12.Nm valloc
13.Nd aligned memory allocation function
14.Sh SYNOPSIS
15.Fd #include <unistd.h>
16.Ft char *
17.Fn valloc "unsigned size"
18.Sh DESCRIPTION
19.Bf -symbolic
20Valloc is obsoleted by the current version of malloc(3),
ba92586e 21which aligns page-sized and larger allocations.
ae59e04c
CL
22.Ef
23.Pp
24The
25.Fn valloc
26function
09c5700e 27allocates
ae59e04c 28.Fa size
c17b03b3 29bytes aligned on a page boundary.
09c5700e 30It is implemented by calling
ae59e04c 31.Xr malloc 3
09c5700e
KM
32with a slightly larger request, saving the true beginning of the block
33allocated, and returning a properly aligned pointer.
ae59e04c
CL
34.Sh RETURN VALUES
35The
36.Fn valloc
37function returns
38a pointer to the allocated space if successful; otherwise
39a null pointer is returned
40.Sh HISTORY
41The
42.Fn valloc
43function appeared in
44.Bx 3.0 .
45.Sh BUGS
46A
47.Em vfree
48function
49has not been implemented.