X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fposix%2Ffunctions%2F_PDCLIB%2F_PDCLIB_freepages.c;fp=platform%2Fposix%2Ffunctions%2F_PDCLIB%2F_PDCLIB_freepages.c;h=ed4ea0ca1fa7a63083498ecc78422954fddbda11;hb=1aba8d4e33b2a020709f81182709c7de7a728c76;hp=0000000000000000000000000000000000000000;hpb=f473bc71fc1f79bf2ef549c768852c6216784e23;p=pdclib diff --git a/platform/posix/functions/_PDCLIB/_PDCLIB_freepages.c b/platform/posix/functions/_PDCLIB/_PDCLIB_freepages.c new file mode 100644 index 0000000..ed4ea0c --- /dev/null +++ b/platform/posix/functions/_PDCLIB/_PDCLIB_freepages.c @@ -0,0 +1,32 @@ +/* _PDCLIB_freepages( void *, size_t ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +/* This is an example implementation of _PDCLIB_allocpages() (declared in + _PDCLIB_config.h), fit for use with POSIX kernels. +*/ + +#ifndef REGTEST +#include +#include +#include +#include <_PDCLIB_glue.h> + +void _PDCLIB_freepages( void * p, size_t n ) +{ + munmap( p, n * _PDCLIB_MALLOC_PAGESIZE ); +} + +#endif + +#ifdef TEST +#include <_PDCLIB_test.h> + +int main( void ) +{ + return TEST_RESULTS; +} + +#endif \ No newline at end of file