__libc_lock_define_initialized (static, list_lock);
/* Already initialized? */
-int __malloc_initialized = -1;
+static bool __malloc_initialized = false;
/**************************************************************************/
void
__malloc_fork_lock_parent (void)
{
- if (__malloc_initialized < 1)
+ if (!__malloc_initialized)
return;
/* We do not acquire free_list_lock here because we completely
void
__malloc_fork_unlock_parent (void)
{
- if (__malloc_initialized < 1)
+ if (!__malloc_initialized)
return;
for (mstate ar_ptr = &main_arena;; )
void
__malloc_fork_unlock_child (void)
{
- if (__malloc_initialized < 1)
+ if (!__malloc_initialized)
return;
/* Push all arenas to the free list, except thread_arena, which is
static void
ptmalloc_init (void)
{
- if (__malloc_initialized >= 0)
+ if (__malloc_initialized)
return;
- __malloc_initialized = 0;
+ __malloc_initialized = true;
#if USE_TCACHE
tcache_key_initialize ();
_Static_assert (PTRDIFF_MAX <= SIZE_MAX / 2,
"PTRDIFF_MAX is not more than half of SIZE_MAX");
- if (__malloc_initialized < 0)
+ if (!__malloc_initialized)
ptmalloc_init ();
#if USE_TCACHE
/* int_free also calls request2size, be careful to not pad twice. */
void *newp; /* chunk to return */
- if (__malloc_initialized < 0)
+ if (!__malloc_initialized)
ptmalloc_init ();
#if REALLOC_ZERO_BYTES_FREES
void *
__libc_memalign (size_t alignment, size_t bytes)
{
- if (__malloc_initialized < 0)
+ if (!__malloc_initialized)
ptmalloc_init ();
void *address = RETURN_ADDRESS (0);
void *
__libc_valloc (size_t bytes)
{
- if (__malloc_initialized < 0)
+ if (!__malloc_initialized)
ptmalloc_init ();
void *address = RETURN_ADDRESS (0);
void *
__libc_pvalloc (size_t bytes)
{
- if (__malloc_initialized < 0)
+ if (!__malloc_initialized)
ptmalloc_init ();
void *address = RETURN_ADDRESS (0);
sz = bytes;
- if (__malloc_initialized < 0)
+ if (!__malloc_initialized)
ptmalloc_init ();
MAYBE_INIT_TCACHE ();
{
int result = 0;
- if (__malloc_initialized < 0)
+ if (!__malloc_initialized)
ptmalloc_init ();
mstate ar_ptr = &main_arena;
struct mallinfo2 m;
mstate ar_ptr;
- if (__malloc_initialized < 0)
+ if (!__malloc_initialized)
ptmalloc_init ();
memset (&m, 0, sizeof (m));
mstate ar_ptr;
unsigned int in_use_b = mp_.mmapped_mem, system_b = in_use_b;
- if (__malloc_initialized < 0)
+ if (!__malloc_initialized)
ptmalloc_init ();
_IO_flockfile (stderr);
int old_flags2 = stderr->_flags2;
mstate av = &main_arena;
int res = 1;
- if (__malloc_initialized < 0)
+ if (!__malloc_initialized)
ptmalloc_init ();
__libc_lock_lock (av->mutex);
{
void *mem;
- if (__malloc_initialized < 0)
+ if (!__malloc_initialized)
ptmalloc_init ();
/* Test whether the SIZE argument is valid. It must be a power of
- if (__malloc_initialized < 0)
+ if (!__malloc_initialized)
ptmalloc_init ();
fputs ("<malloc version=\"1\">\n", fp);