1*61111Sbostic.\" Copyright (c) 1980, 1991, 1993 2*61111Sbostic.\" The Regents of the University of California. All rights reserved. 320467Smckusick.\" 448352Scael.\" %sccs.include.redist.man% 520467Smckusick.\" 6*61111Sbostic.\" @(#)valloc.3 8.1 (Berkeley) 06/04/93 748352Scael.\" 848352Scael.Dd 948352Scael.Dt VALLOC 3 1048352Scael.Os BSD 3 1148352Scael.Sh NAME 1248352Scael.Nm valloc 1348352Scael.Nd aligned memory allocation function 1448352Scael.Sh SYNOPSIS 1548352Scael.Fd #include <unistd.h> 1648352Scael.Ft char * 1748352Scael.Fn valloc "unsigned size" 1848352Scael.Sh DESCRIPTION 1948352Scael.Bf -symbolic 2048352ScaelValloc is obsoleted by the current version of malloc(3), 2128041Skarelswhich aligns page-sized and larger allocations. 2248352Scael.Ef 2348352Scael.Pp 2448352ScaelThe 2548352Scael.Fn valloc 2648352Scaelfunction 2720467Smckusickallocates 2848352Scael.Fa size 2920468Smckusickbytes aligned on a page boundary. 3020467SmckusickIt is implemented by calling 3148352Scael.Xr malloc 3 3220467Smckusickwith a slightly larger request, saving the true beginning of the block 3320467Smckusickallocated, and returning a properly aligned pointer. 3448352Scael.Sh RETURN VALUES 3548352ScaelThe 3648352Scael.Fn valloc 3748352Scaelfunction returns 3848352Scaela pointer to the allocated space if successful; otherwise 3948352Scaela null pointer is returned 4048352Scael.Sh HISTORY 4148352ScaelThe 4248352Scael.Fn valloc 4348352Scaelfunction appeared in 4448352Scael.Bx 3.0 . 4548352Scael.Sh BUGS 4648352ScaelA 4748352Scael.Em vfree 4848352Scaelfunction 4948352Scaelhas not been implemented. 50