/* specific platforms, e.g. by swapping int instead of char. */
#define _PDCLIB_memswp( i, j, size ) char tmp; do { tmp = *i; *i++ = *j; *j++ = tmp; } while ( --size );
-/* Define this to some compiler directive that can be written after the */
-/* parameter list of a function declaration to indicate the function does */
-/* never return. If your compiler does not support such a directive, define */
-/* to nothing. (This is to avoid warnings with the exit functions under GCC.) */
-#define _PDCLIB_NORETURN __attribute__(( noreturn ))
-
/* The maximum value that errno can be set to. This is used to set the size */
/* of the array in struct lconv (<locale.h>) holding error messages for the */
/* strerror() and perror() functions. (If you change this value because you */
/* Large enough an integer to hold all character codes of the largest supported
locale.
*/
-#define _PDCLIB_wchar unsigned short
-#define _PDCLIB_WCHAR USHRT
+#define _PDCLIB_wint signed int
+#define _PDCLIB_wchar unsigned int
+#define _PDCLIB_WCHAR UINT
#define _PDCLIB_intptr int
#define _PDCLIB_INTPTR INT
#define _PDCLIB_clock double
#define _PDCLIB_CLOCKS_PER_SEC 1000000
+/* <time.h>: TIME_UTC
+ *
+ * The TIME_UTC parameter is passed to the timespec_get function in order to get
+ * the system time in UTC since an implementation defined epoch (not necessarily
+ * the same as that used for time_t). That said, on POSIX the obvious
+ * implementation of timespec_get for TIME_UTC is to wrap
+ * clock_gettime(CLOCK_REALTIME, ...), which is defined as time in UTC since the
+ * same epoch.
+ *
+ * This may be any non-zero integer value.
+ */
+#define _PDCLIB_TIME_UTC 1
+
/* -------------------------------------------------------------------------- */
/* Floating Point */
/* -------------------------------------------------------------------------- */
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 size
- will be satisfied by a malloc() of this size instead (to avoid excessive
- fragmentation).
-*/
-#define _PDCLIB_MINALLOC 8
+#define _PDCLIB_MALLOC_PAGESIZE 4096
+#define _PDCLIB_MALLOC_ALIGN 16
+#define _PDCLIB_MALLOC_GRANULARITY 64*1024
+#define _PDCLIB_MALLOC_TRIM_THRESHOLD 2*1024*1024
+#define _PDCLIB_MALLOC_MMAP_THRESHOLD 256*1024
+#define _PDCLIB_MALLOC_RELEASE_CHECK_RATE 4095
+
+/* TODO: Better document these */
/* I/O ---------------------------------------------------------------------- */