Commit | Line | Data |
---|---|---|
09c5700e KM |
1 | .\" Copyright (c) 1980 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
ba92586e | 5 | .\" @(#)valloc.3 6.2 (Berkeley) %G% |
09c5700e | 6 | .\" |
ba92586e | 7 | .TH VALLOC 3C "" |
09c5700e KM |
8 | .UC 3 |
9 | .SH NAME | |
10 | valloc \- aligned memory allocator | |
11 | .SH SYNOPSIS | |
12 | .nf | |
13 | .B char *valloc(size) | |
14 | .B unsigned size; | |
15 | .fi | |
16 | .SH DESCRIPTION | |
ba92586e MK |
17 | .ft B |
18 | Valloc is obsoleted by the current version of malloc, | |
19 | which aligns page-sized and larger allocations. | |
20 | .ft R | |
21 | .PP | |
09c5700e KM |
22 | .I Valloc |
23 | allocates | |
24 | .I size | |
c17b03b3 | 25 | bytes aligned on a page boundary. |
09c5700e KM |
26 | It is implemented by calling |
27 | .IR malloc (3) | |
28 | with a slightly larger request, saving the true beginning of the block | |
29 | allocated, and returning a properly aligned pointer. | |
30 | .SH DIAGNOSTICS | |
31 | .I Valloc | |
32 | returns a null pointer (0) if there is no available memory | |
33 | or if the arena has been detectably corrupted by storing outside the bounds | |
34 | of a block. | |
35 | .SH BUGS | |
36 | .I Vfree | |
37 | isn't implemented. |