Commit | Line | Data |
---|---|---|
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 | |
20 | Valloc is obsoleted by the current version of malloc(3), | |
ba92586e | 21 | which aligns page-sized and larger allocations. |
ae59e04c CL |
22 | .Ef |
23 | .Pp | |
24 | The | |
25 | .Fn valloc | |
26 | function | |
09c5700e | 27 | allocates |
ae59e04c | 28 | .Fa size |
c17b03b3 | 29 | bytes aligned on a page boundary. |
09c5700e | 30 | It is implemented by calling |
ae59e04c | 31 | .Xr malloc 3 |
09c5700e KM |
32 | with a slightly larger request, saving the true beginning of the block |
33 | allocated, and returning a properly aligned pointer. | |
ae59e04c CL |
34 | .Sh RETURN VALUES |
35 | The | |
36 | .Fn valloc | |
37 | function returns | |
38 | a pointer to the allocated space if successful; otherwise | |
39 | a null pointer is returned | |
40 | .Sh HISTORY | |
41 | The | |
42 | .Fn valloc | |
43 | function appeared in | |
44 | .Bx 3.0 . | |
45 | .Sh BUGS | |
46 | A | |
47 | .Em vfree | |
48 | function | |
49 | has not been implemented. |