Differential D24522 Diff 70932 head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h
Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal_types.h
#ifndef JEMALLOC_INTERNAL_TYPES_H | #ifndef JEMALLOC_INTERNAL_TYPES_H | ||||
#define JEMALLOC_INTERNAL_TYPES_H | #define JEMALLOC_INTERNAL_TYPES_H | ||||
#include "jemalloc/internal/quantum.h" | |||||
/* Page size index type. */ | /* Page size index type. */ | ||||
typedef unsigned pszind_t; | typedef unsigned pszind_t; | ||||
/* Size class index type. */ | /* Size class index type. */ | ||||
typedef unsigned szind_t; | typedef unsigned szind_t; | ||||
/* Processor / core id type. */ | /* Processor / core id type. */ | ||||
typedef int malloc_cpuid_t; | typedef int malloc_cpuid_t; | ||||
Show All 32 Lines | |||||
#define MALLOCX_TCACHE_GET(flags) \ | #define MALLOCX_TCACHE_GET(flags) \ | ||||
(((unsigned)((flags & MALLOCX_TCACHE_MASK) >> MALLOCX_TCACHE_SHIFT)) - 2) | (((unsigned)((flags & MALLOCX_TCACHE_MASK) >> MALLOCX_TCACHE_SHIFT)) - 2) | ||||
#define MALLOCX_ARENA_GET(flags) \ | #define MALLOCX_ARENA_GET(flags) \ | ||||
(((unsigned)(((unsigned)flags) >> MALLOCX_ARENA_SHIFT)) - 1) | (((unsigned)(((unsigned)flags) >> MALLOCX_ARENA_SHIFT)) - 1) | ||||
/* Smallest size class to support. */ | /* Smallest size class to support. */ | ||||
#define TINY_MIN (1U << LG_TINY_MIN) | #define TINY_MIN (1U << LG_TINY_MIN) | ||||
/* | |||||
* Minimum allocation alignment is 2^LG_QUANTUM bytes (ignoring tiny size | |||||
* classes). | |||||
*/ | |||||
#ifndef LG_QUANTUM | |||||
# if (defined(__i386__) || defined(_M_IX86)) | |||||
# define LG_QUANTUM 4 | |||||
# endif | |||||
# ifdef __ia64__ | |||||
# define LG_QUANTUM 4 | |||||
# endif | |||||
# ifdef __alpha__ | |||||
# define LG_QUANTUM 4 | |||||
# endif | |||||
# if (defined(__sparc64__) || defined(__sparcv9) || defined(__sparc_v9__)) | |||||
# define LG_QUANTUM 4 | |||||
# endif | |||||
# if (defined(__amd64__) || defined(__x86_64__) || defined(_M_X64)) | |||||
# define LG_QUANTUM 4 | |||||
# endif | |||||
# ifdef __arm__ | |||||
# define LG_QUANTUM 3 | |||||
# endif | |||||
# ifdef __aarch64__ | |||||
# define LG_QUANTUM 4 | |||||
# endif | |||||
# ifdef __hppa__ | |||||
# define LG_QUANTUM 4 | |||||
# endif | |||||
# ifdef __m68k__ | |||||
# define LG_QUANTUM 3 | |||||
# endif | |||||
# ifdef __mips__ | |||||
# define LG_QUANTUM 3 | |||||
# endif | |||||
# ifdef __nios2__ | |||||
# define LG_QUANTUM 3 | |||||
# endif | |||||
# ifdef __or1k__ | |||||
# define LG_QUANTUM 3 | |||||
# endif | |||||
# ifdef __powerpc__ | |||||
# define LG_QUANTUM 4 | |||||
# endif | |||||
# if defined(__riscv) || defined(__riscv__) | |||||
# define LG_QUANTUM 4 | |||||
# endif | |||||
# ifdef __s390__ | |||||
# define LG_QUANTUM 4 | |||||
# endif | |||||
# if (defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || \ | |||||
defined(__SH4_SINGLE_ONLY__)) | |||||
# define LG_QUANTUM 4 | |||||
# endif | |||||
# ifdef __tile__ | |||||
# define LG_QUANTUM 4 | |||||
# endif | |||||
# ifdef __le32__ | |||||
# define LG_QUANTUM 4 | |||||
# endif | |||||
# ifndef LG_QUANTUM | |||||
# error "Unknown minimum alignment for architecture; specify via " | |||||
"--with-lg-quantum" | |||||
# endif | |||||
#endif | |||||
#define QUANTUM ((size_t)(1U << LG_QUANTUM)) | |||||
#define QUANTUM_MASK (QUANTUM - 1) | |||||
/* Return the smallest quantum multiple that is >= a. */ | |||||
#define QUANTUM_CEILING(a) \ | |||||
(((a) + QUANTUM_MASK) & ~QUANTUM_MASK) | |||||
#define LONG ((size_t)(1U << LG_SIZEOF_LONG)) | #define LONG ((size_t)(1U << LG_SIZEOF_LONG)) | ||||
#define LONG_MASK (LONG - 1) | #define LONG_MASK (LONG - 1) | ||||
/* Return the smallest long multiple that is >= a. */ | /* Return the smallest long multiple that is >= a. */ | ||||
#define LONG_CEILING(a) \ | #define LONG_CEILING(a) \ | ||||
(((a) + LONG_MASK) & ~LONG_MASK) | (((a) + LONG_MASK) & ~LONG_MASK) | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |