mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 11:37:35 +00:00
fa20edc44d
- Remove most __ASSEMBLER__ __LINKER__ ifdefs - Rename libc/intrin/bits.h to libc/serialize.h - Block pthread cancelation in fchmodat() polyfill - Remove `clang-format off` statements in third_party
34 lines
871 B
C++
34 lines
871 B
C++
|
|
/* ------------- Global malloc_state and malloc_params ------------------- */
|
|
|
|
/*
|
|
malloc_params holds global properties, including those that can be
|
|
dynamically set using mallopt. There is a single instance, mparams,
|
|
initialized in init_mparams. Note that the non-zeroness of "magic"
|
|
also serves as an initialization flag.
|
|
*/
|
|
|
|
struct malloc_params {
|
|
size_t magic;
|
|
size_t page_size;
|
|
size_t granularity;
|
|
size_t mmap_threshold;
|
|
size_t trim_threshold;
|
|
flag_t default_mflags;
|
|
};
|
|
|
|
static struct malloc_params mparams;
|
|
|
|
/* Ensure mparams initialized */
|
|
#define ensure_initialization() (void)0
|
|
|
|
#if !ONLY_MSPACES
|
|
|
|
/* The global malloc_state used for all non-"mspace" calls */
|
|
static struct malloc_state _gm_;
|
|
#define gm (&_gm_)
|
|
#define is_global(M) ((M) == &_gm_)
|
|
|
|
#endif /* !ONLY_MSPACES */
|
|
|
|
#define is_initialized(M) ((M)->top != 0)
|