• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #  ifdef _WIN64
9 #    if LG_VADDR <= 32
10 #      error Generate the headers using x64 vcargs
11 #    endif
12 #  else
13 #    if LG_VADDR > 32
14 #      undef LG_VADDR
15 #      define LG_VADDR 32
16 #    endif
17 #  endif
18 #else
19 #  include <sys/param.h>
20 #  include <sys/mman.h>
21 #  if !defined(__pnacl__) && !defined(__native_client__)
22 #    include <sys/syscall.h>
23 #    if !defined(SYS_write) && defined(__NR_write)
24 #      define SYS_write __NR_write
25 #    endif
26 #    if defined(SYS_open) && defined(__aarch64__)
27        /* Android headers may define SYS_open to __NR_open even though
28         * __NR_open may not exist on AArch64 (superseded by __NR_openat). */
29 #      undef SYS_open
30 #    endif
31 #    include <sys/uio.h>
32 #  endif
33 #  include <pthread.h>
34 #  include <signal.h>
35 #  ifdef JEMALLOC_OS_UNFAIR_LOCK
36 #    include <os/lock.h>
37 #  endif
38 #  ifdef JEMALLOC_GLIBC_MALLOC_HOOK
39 #    include <sched.h>
40 #  endif
41 #  include <errno.h>
42 #  include <sys/time.h>
43 #  include <time.h>
44 #  ifdef JEMALLOC_HAVE_MACH_ABSOLUTE_TIME
45 #    include <mach/mach_time.h>
46 #  endif
47 #endif
48 #include <sys/types.h>
49 
50 #include <limits.h>
51 #ifndef SIZE_T_MAX
52 #  define SIZE_T_MAX	SIZE_MAX
53 #endif
54 #ifndef SSIZE_MAX
55 #  define SSIZE_MAX	((ssize_t)(SIZE_T_MAX >> 1))
56 #endif
57 #include <stdarg.h>
58 #include <stdbool.h>
59 #include <stdio.h>
60 #include <stdlib.h>
61 #include <stdint.h>
62 #include <stddef.h>
63 #ifndef offsetof
64 #  define offsetof(type, member)	((size_t)&(((type *)NULL)->member))
65 #endif
66 #include <string.h>
67 #include <strings.h>
68 #include <ctype.h>
69 #ifdef _MSC_VER
70 #  include <io.h>
71 typedef intptr_t ssize_t;
72 #  define PATH_MAX 1024
73 #  define STDERR_FILENO 2
74 #  define __func__ __FUNCTION__
75 #  ifdef JEMALLOC_HAS_RESTRICT
76 #    define restrict __restrict
77 #  endif
78 /* Disable warnings about deprecated system functions. */
79 #  pragma warning(disable: 4996)
80 #if _MSC_VER < 1800
81 static int
isblank(int c)82 isblank(int c) {
83 	return (c == '\t' || c == ' ');
84 }
85 #endif
86 #else
87 #  include <unistd.h>
88 #endif
89 #include <fcntl.h>
90 
91 #endif /* JEMALLOC_INTERNAL_H */
92