Header refactoring: Split up jemalloc_internal.h

This is a biggy.  jemalloc_internal.h has been doing multiple jobs for a while
now:
- The source of system-wide definitions.
- The catch-all include file.
- The module header file for jemalloc.c

This commit splits up this functionality.  The system-wide definitions
responsibility has moved to jemalloc_preamble.h.  The catch-all include file is
now jemalloc_internal_includes.h.  The module headers for jemalloc.c are now in
jemalloc_internal_[externs|inlines|types].h, just as they are for the other
modules.
This commit is contained in:
David Goldblatt
2017-04-10 18:17:55 -07:00
committed by David Goldblatt
parent 0237870c60
commit 743d940dc3
38 changed files with 1396 additions and 1337 deletions

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_ARENA_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/******************************************************************************/
/* Data. */

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_BASE_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/******************************************************************************/
/* Data. */

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_BITMAP_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/******************************************************************************/

View File

@@ -35,7 +35,8 @@
*
******************************************************************************/
#define JEMALLOC_CKH_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/******************************************************************************/
/* Function prototypes for non-inline static functions. */

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_CTL_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/******************************************************************************/
/* Data. */

View File

@@ -1,8 +1,10 @@
#define JEMALLOC_EXTENT_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/ph.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/******************************************************************************/
/* Data. */

View File

@@ -1,5 +1,7 @@
#define JEMALLOC_EXTENT_DSS_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/******************************************************************************/
/* Data. */

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_EXTENT_MMAP_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/******************************************************************************/

View File

@@ -1,2 +1,3 @@
#define JEMALLOC_HASH_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"

View File

@@ -1,4 +1,4 @@
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
/*
* The hooks are a little bit screwy -- they're not genuinely exported in the

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/******************************************************************************/
/* Data. */

View File

@@ -2,7 +2,8 @@
#include <new>
#define JEMALLOC_CPP_CPP_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
// All operators in this file are exported.

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_LARGE_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/******************************************************************************/

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_MALLOC_IO_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
#ifdef assert
# undef assert

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_MUTEX_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
#if defined(JEMALLOC_LAZY_LOCK) && !defined(_WIN32)
#include <dlfcn.h>

View File

@@ -1,4 +1,5 @@
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
#define BILLION UINT64_C(1000000000)
#define MILLION UINT64_C(1000000)

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_PAGES_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
#ifdef JEMALLOC_SYSCTL_VM_OVERCOMMIT
#include <sys/sysctl.h>

View File

@@ -1,2 +1,3 @@
#define JEMALLOC_PRNG_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"

View File

@@ -1,5 +1,7 @@
#define JEMALLOC_PROF_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/******************************************************************************/
#ifdef JEMALLOC_PROF_LIBUNWIND

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_RTREE_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/*
* Only the most significant bits of keys passed to rtree_{read,write}() are

View File

@@ -1,2 +1,3 @@
#define JEMALLOC_SPIN_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_STATS_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
const char *global_mutex_names[num_global_prof_mutexes] = {
#define OP(mtx) #mtx,

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_TCACHE_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/******************************************************************************/
/* Data. */

View File

@@ -1,2 +1,3 @@
#define JEMALLOC_TICKER_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_TSD_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
/******************************************************************************/
/* Data. */

View File

@@ -1,5 +1,6 @@
#define JEMALLOC_WITNESS_C_
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
void
witness_init(witness_t *witness, const char *name, witness_rank_t rank,

View File

@@ -1,4 +1,5 @@
#include "jemalloc/internal/jemalloc_internal.h"
#include "jemalloc/internal/jemalloc_preamble.h"
#include "jemalloc/internal/jemalloc_internal_includes.h"
#ifndef JEMALLOC_ZONE
# error "This source file is for zones on Darwin (OS X)."
#endif