xref: /original-bsd/lib/libc/gen/valloc.3 (revision c3e32dec)
1.\" Copyright (c) 1980, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)valloc.3	8.1 (Berkeley) 06/04/93
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),
21which aligns page-sized and larger allocations.
22.Ef
23.Pp
24The
25.Fn valloc
26function
27allocates
28.Fa size
29bytes aligned on a page boundary.
30It is implemented by calling
31.Xr malloc 3
32with a slightly larger request, saving the true beginning of the block
33allocated, and returning a properly aligned pointer.
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.
50