1#ifndef JEMALLOC_INTERNAL_DECLS_H
2#define JEMALLOC_INTERNAL_DECLS_H
3
4#include <math.h>
5#ifdef _WIN32
6# include <windows.h>
7# include "msvc_compat/windows_extra.h"
8# include "msvc_compat/strings.h"
9# ifdef _WIN64
10# if LG_VADDR <= 32
11# error Generate the headers using x64 vcargs
12# endif
13# else
14# if LG_VADDR > 32
15# undef LG_VADDR
16# define LG_VADDR 32
17# endif
18# endif
19#else
20# include <sys/param.h>
21# include <sys/mman.h>
22# if !defined(__pnacl__) && !defined(__native_client__)
23# include <sys/syscall.h>
24# if !defined(SYS_write) && defined(__NR_write)
25# define SYS_write __NR_write
26# endif
27# if defined(SYS_open) && defined(__aarch64__)
28 /* Android headers may define SYS_open to __NR_open even though
29 * __NR_open may not exist on AArch64 (superseded by __NR_openat). */
30# undef SYS_open
31# endif
32# include <sys/uio.h>
33# endif
34# include <pthread.h>
35# if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
36# include <pthread_np.h>
37# include <sched.h>
38# if defined(__FreeBSD__)
39# define cpu_set_t cpuset_t
40# endif
41# endif
42# include <signal.h>
43# ifdef JEMALLOC_OS_UNFAIR_LOCK
44# include <os/lock.h>
45# endif
46# ifdef JEMALLOC_GLIBC_MALLOC_HOOK
47# include <sched.h>
48# endif
49# include <errno.h>
50# include <sys/time.h>
51# include <time.h>
52# ifdef JEMALLOC_HAVE_MACH_ABSOLUTE_TIME
53# include <mach/mach_time.h>
54# endif
55#endif
56#include <sys/types.h>
57
58#include <limits.h>
59#ifndef SIZE_T_MAX
60# define SIZE_T_MAX SIZE_MAX
61#endif
62#ifndef SSIZE_MAX
63# define SSIZE_MAX ((ssize_t)(SIZE_T_MAX >> 1))
64#endif
65#include <stdarg.h>
66#include <stdbool.h>
67#include <stdio.h>
68#include <stdlib.h>
69#include <stdint.h>
70#include <stddef.h>
71#ifndef offsetof
72# define offsetof(type, member) ((size_t)&(((type *)NULL)->member))
73#endif
74#include <string.h>
75#include <strings.h>
76#include <ctype.h>
77#ifdef _MSC_VER
78# include <io.h>
79typedef intptr_t ssize_t;
80# define PATH_MAX 1024
81# define STDERR_FILENO 2
82# define __func__ __FUNCTION__
83# ifdef JEMALLOC_HAS_RESTRICT
84# define restrict __restrict
85# endif
86/* Disable warnings about deprecated system functions. */
87# pragma warning(disable: 4996)
88#if _MSC_VER < 1800
89static int
90isblank(int c) {
91 return (c == '\t' || c == ' ');
92}
93#endif
94#else
95# include <unistd.h>
96#endif
97#include <fcntl.h>
98
99/*
100 * The Win32 midl compiler has #define small char; we don't use midl, but
101 * "small" is a nice identifier to have available when talking about size
102 * classes.
103 */
104#ifdef small
105# undef small
106#endif
107
108#endif /* JEMALLOC_INTERNAL_H */
109