]> Git Repo - uclibc-ng.git/blame - libc/stdlib/valloc.c
nds32: sync with binutils 2.37, gcc 11.2 and linux 5.10.93 changes
[uclibc-ng.git] / libc / stdlib / valloc.c
CommitLineData
4d810f5f
SH
1/* Allocate memory on a page boundary.
2 Copyright (C) 1991, 1992 Free Software Foundation, Inc.
3
4This library is free software; you can redistribute it and/or
5modify it under the terms of the GNU Library General Public License as
6published by the Free Software Foundation; either version 2 of the
7License, or (at your option) any later version.
8
9This library is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12Library General Public License for more details.
13
14You should have received a copy of the GNU Library General Public
15License along with this library; see the file COPYING.LIB. If
266bdc1f 16not, see <http://www.gnu.org/licenses/>.
4d810f5f
SH
17
18 The author may be reached (Email) at the address mike@@ai.mit.edu,
19 or (US mail) as Mike Haertel c/o Free Software Foundation. */
20
21#include <stdlib.h>
9613b659 22#include <unistd.h>
742b3c93 23#include <malloc.h>
4d810f5f 24
af017216 25
4d810f5f
SH
26static size_t pagesize;
27
28__ptr_t valloc (size_t size)
29{
30 if (pagesize == 0)
9613b659 31 pagesize = getpagesize ();
4d810f5f 32
9613b659 33 return memalign(pagesize, size);
4d810f5f 34}
This page took 0.193241 seconds and 4 git commands to generate.