Move last bit of zone initialization in zone.c, and lazy-initialize
This commit is contained in:
parent
722b370399
commit
80b25932ca
@ -304,9 +304,6 @@ static const bool config_ivsalloc =
|
|||||||
#include "jemalloc/internal/rtree.h"
|
#include "jemalloc/internal/rtree.h"
|
||||||
#include "jemalloc/internal/tcache.h"
|
#include "jemalloc/internal/tcache.h"
|
||||||
#include "jemalloc/internal/hash.h"
|
#include "jemalloc/internal/hash.h"
|
||||||
#ifdef JEMALLOC_ZONE
|
|
||||||
#include "jemalloc/internal/zone.h"
|
|
||||||
#endif
|
|
||||||
#include "jemalloc/internal/prof.h"
|
#include "jemalloc/internal/prof.h"
|
||||||
|
|
||||||
#undef JEMALLOC_H_TYPES
|
#undef JEMALLOC_H_TYPES
|
||||||
@ -332,9 +329,6 @@ static const bool config_ivsalloc =
|
|||||||
#include "jemalloc/internal/rtree.h"
|
#include "jemalloc/internal/rtree.h"
|
||||||
#include "jemalloc/internal/tcache.h"
|
#include "jemalloc/internal/tcache.h"
|
||||||
#include "jemalloc/internal/hash.h"
|
#include "jemalloc/internal/hash.h"
|
||||||
#ifdef JEMALLOC_ZONE
|
|
||||||
#include "jemalloc/internal/zone.h"
|
|
||||||
#endif
|
|
||||||
#include "jemalloc/internal/prof.h"
|
#include "jemalloc/internal/prof.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -400,9 +394,6 @@ void jemalloc_postfork_child(void);
|
|||||||
#include "jemalloc/internal/rtree.h"
|
#include "jemalloc/internal/rtree.h"
|
||||||
#include "jemalloc/internal/tcache.h"
|
#include "jemalloc/internal/tcache.h"
|
||||||
#include "jemalloc/internal/hash.h"
|
#include "jemalloc/internal/hash.h"
|
||||||
#ifdef JEMALLOC_ZONE
|
|
||||||
#include "jemalloc/internal/zone.h"
|
|
||||||
#endif
|
|
||||||
#include "jemalloc/internal/prof.h"
|
#include "jemalloc/internal/prof.h"
|
||||||
|
|
||||||
#undef JEMALLOC_H_EXTERNS
|
#undef JEMALLOC_H_EXTERNS
|
||||||
@ -565,9 +556,6 @@ choose_arena(void)
|
|||||||
#include "jemalloc/internal/tcache.h"
|
#include "jemalloc/internal/tcache.h"
|
||||||
#include "jemalloc/internal/arena.h"
|
#include "jemalloc/internal/arena.h"
|
||||||
#include "jemalloc/internal/hash.h"
|
#include "jemalloc/internal/hash.h"
|
||||||
#ifdef JEMALLOC_ZONE
|
|
||||||
#include "jemalloc/internal/zone.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef JEMALLOC_ENABLE_INLINE
|
#ifndef JEMALLOC_ENABLE_INLINE
|
||||||
void *imalloc(size_t size);
|
void *imalloc(size_t size);
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
#ifndef JEMALLOC_ZONE
|
|
||||||
# error "This source file is for zones on Darwin (OS X)."
|
|
||||||
#endif
|
|
||||||
/******************************************************************************/
|
|
||||||
#ifdef JEMALLOC_H_TYPES
|
|
||||||
|
|
||||||
#endif /* JEMALLOC_H_TYPES */
|
|
||||||
/******************************************************************************/
|
|
||||||
#ifdef JEMALLOC_H_STRUCTS
|
|
||||||
|
|
||||||
#endif /* JEMALLOC_H_STRUCTS */
|
|
||||||
/******************************************************************************/
|
|
||||||
#ifdef JEMALLOC_H_EXTERNS
|
|
||||||
|
|
||||||
void register_zone(void);
|
|
||||||
|
|
||||||
#endif /* JEMALLOC_H_EXTERNS */
|
|
||||||
/******************************************************************************/
|
|
||||||
#ifdef JEMALLOC_H_INLINES
|
|
||||||
|
|
||||||
#endif /* JEMALLOC_H_INLINES */
|
|
||||||
/******************************************************************************/
|
|
@ -717,17 +717,6 @@ malloc_init_hard(void)
|
|||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JEMALLOC_ZONE
|
|
||||||
JEMALLOC_ATTR(constructor)
|
|
||||||
void
|
|
||||||
jemalloc_darwin_init(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (malloc_init_hard() == false)
|
|
||||||
register_zone();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* End initialization functions.
|
* End initialization functions.
|
||||||
*/
|
*/
|
||||||
|
@ -166,6 +166,7 @@ zone_force_unlock(malloc_zone_t *zone)
|
|||||||
jemalloc_postfork_parent();
|
jemalloc_postfork_parent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JEMALLOC_ATTR(constructor)
|
||||||
void
|
void
|
||||||
register_zone(void)
|
register_zone(void)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user