X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=internals%2F_PDCLIB_config.h;h=41fe02cb3f62711e2ee40b482ef3adc66f3137f7;hb=137bef7f4838fc430682213fa628e16b2237ed63;hp=d2188ff112f8657124884bf3b54dd700138fa2ca;hpb=744bbe0fcec2f59f755dd56fa59d8979f4253dfd;p=pdclib diff --git a/internals/_PDCLIB_config.h b/internals/_PDCLIB_config.h index d2188ff..41fe02c 100644 --- a/internals/_PDCLIB_config.h +++ b/internals/_PDCLIB_config.h @@ -121,7 +121,7 @@ struct _PDCLIB_lldiv_t */ #define _PDCLIB_SIG_ATOMIC INT -/* Result type of the 'sizeof' operator */ +/* Result type of the 'sizeof' operator (must be unsigned) */ #define _PDCLIB_size unsigned int #define _PDCLIB_SIZE UINT @@ -199,3 +199,33 @@ typedef char * _PDCLIB_va_list; #define _PDCLIB_va_copy( dest, src ) ( (dest) = (src), (void)0 ) #define _PDCLIB_va_end( ap ) ( (ap) = (void *)0, (void)0 ) #define _PDCLIB_va_start( ap, parmN ) ( (ap) = (char *) &parmN + ( _PDCLIB_va_round(parmN) ), (void)0 ) + +/* -------------------------------------------------------------------------- */ +/* OS "glue" */ +/* This is where PDCLib interfaces with the operating system. The examples */ +/* below are POSIX calls; provide your OS' equivalents. */ +/* -------------------------------------------------------------------------- */ + +/* A system call that terminates the calling process */ +void _exit( int status ) __attribute__(( noreturn )); +#define _PDCLIB_Exit( x ) _exit( x ) + +/* Memory management */ + +/* Set this to the page size of your OS. If your OS does not support paging, set + to an appropriate value. (Too small, and malloc() will call the kernel too + often. Too large, and you will waste memory. +*/ +#define _PDCLIB_PAGESIZE 4096 + +/* Set this to the minimum memory node size. Any malloc() for a smaller siz + will be satisfied by a malloc() of this size instead. +*/ +#define _PDCLIB_MINALLOC 8 + +/* Request another x pages (of size _PDCLIB_PAGESIZE) of memory from the kernel, + or release them back to the kernel if n is negative. + Return a (void *) pointing to the former end-of-heap if successful, NULL + otherwise. +*/ +void * _PDCLIB_allocpages( int n );