Current Path : /usr/src/contrib/cvs/lib/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/src/contrib/cvs/lib/valloc.c |
/* valloc -- return memory aligned to the page size. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "system.h" #ifndef HAVE_GETPAGESIZE # include "getpagesize.h" #endif void * valloc (bytes) size_t bytes; { long pagesize; char *ret; pagesize = getpagesize (); ret = (char *) malloc (bytes + pagesize - 1); if (ret) ret = (char *) ((long) (ret + pagesize - 1) &~ (pagesize - 1)); return ret; }