]> pd.if.org Git - pdclib/blob - platform/posix/functions/_PDCLIB/_PDCLIB_freepages.c
7bf5270050f9913917a1dfc438bab8082e0124ce
[pdclib] / platform / posix / functions / _PDCLIB / _PDCLIB_freepages.c
1 /* _PDCLIB_freepages( void *, size_t )
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 /* This is an example implementation of _PDCLIB_allocpages() (declared in
8    _PDCLIB_config.h), fit for use with POSIX kernels.
9 */
10
11 #ifndef REGTEST
12 #include <stdint.h>
13 #include <stddef.h>
14 #include <sys/mman.h>
15 #include "_PDCLIB_glue.h"
16
17 void _PDCLIB_freepages( void * p, size_t n )
18 {
19     munmap( p, n * _PDCLIB_MALLOC_PAGESIZE );
20 }
21
22 #endif
23
24 #ifdef TEST
25 #include "_PDCLIB_test.h"
26
27 int main( void )
28 {
29     return TEST_RESULTS;
30 }
31
32 #endif