| 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 | .\" |
| 5 | .\" @(#)valloc.3 6.2 (Berkeley) %G% |
| 6 | .\" |
| 7 | .TH VALLOC 3C "" |
| 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 |
| 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 |
| 22 | .I Valloc |
| 23 | allocates |
| 24 | .I size |
| 25 | bytes aligned on a page boundary. |
| 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. |