Ken Arnold's version from UNIX Review
[unix-history] / usr / src / lib / libc / gen / valloc.3
... / ...
CommitLineData
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
10valloc \- 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
18Valloc is obsoleted by the current version of malloc,
19which aligns page-sized and larger allocations.
20.ft R
21.PP
22.I Valloc
23allocates
24.I size
25bytes aligned on a page boundary.
26It is implemented by calling
27.IR malloc (3)
28with a slightly larger request, saving the true beginning of the block
29allocated, and returning a properly aligned pointer.
30.SH DIAGNOSTICS
31.I Valloc
32returns a null pointer (0) if there is no available memory
33or if the arena has been detectably corrupted by storing outside the bounds
34of a block.
35.SH BUGS
36.I Vfree
37isn't implemented.