📄 valloc.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>valloc</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_010_346"> </a>NAME</h4><blockquote>valloc - page-aligned memory allocator(<b>LEGACY</b>)</blockquote><h4><a name = "tag_000_010_347"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="stdlib.h.html">stdlib.h</a>>void *valloc(size_t <i>size</i>);</code></pre></blockquote><h4><a name = "tag_000_010_348"> </a>DESCRIPTION</h4><blockquote>The<i>valloc()</i>function has the same effect as<i><a href="malloc.html">malloc()</a></i>,except that the allocated memory will be aligned to a multiple of thevalue returned by <i>sysconf</i>(_SC_PAGESIZE).<p>This interface need not be reentrant.</blockquote><h4><a name = "tag_000_010_349"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>valloc()</i>returns a pointer to the allocated memory. Otherwise,<i>valloc()</i>returns a null pointer and sets<i>errno</i>to indicate the error.<p>If <i>size</i> is 0, the behaviour is implementation-dependent; the valuereturned will be either a null pointer or a unique pointer. When <i>size</i>is 0 and<i>valloc()</i>returns a null pointer,<i>errno</i>is not modified.</blockquote><h4><a name = "tag_000_010_350"> </a>ERRORS</h4><blockquote>The<i>valloc()</i>function will fail if:<dl compact><dt>[ENOMEM]<dd>Storage space available is insufficient.</dl></blockquote><h4><a name = "tag_000_010_351"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_352"> </a>APPLICATION USAGE</h4><blockquote>Applications should avoid using<i>valloc()</i>but should use<i><a href="malloc.html">malloc()</a></i>or<i><a href="mmap.html">mmap()</a></i>instead. On systems with a large page size, the number of successful<i>valloc()</i>operations may be zero.</blockquote><h4><a name = "tag_000_010_353"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_010_354"> </a>SEE ALSO</h4><blockquote><i><a href="malloc.html">malloc()</a></i>,<i><a href="sysconf.html">sysconf()</a></i>,<i><a href="stdlib.h.html"><stdlib.h></a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -