Make jemalloc.h formatting more consistent.

This commit is contained in:
Jason Evans 2013-12-07 11:53:26 -08:00
parent 748dfac778
commit 9f35a71a81
4 changed files with 66 additions and 63 deletions

View File

@ -13,7 +13,10 @@ EOF
for hdr in jemalloc_defs.h jemalloc_macros.h jemalloc_protos.h \ for hdr in jemalloc_defs.h jemalloc_macros.h jemalloc_protos.h \
jemalloc_mangle.h ; do jemalloc_mangle.h ; do
cat "${objroot}include/jemalloc/${hdr}" | grep -v 'Generated from .* by configure\.' cat "${objroot}include/jemalloc/${hdr}" \
| grep -v 'Generated from .* by configure\.' \
| sed -e 's/^#define /#define /g' \
| sed -e 's/ $//g'
echo echo
done done

View File

@ -5,8 +5,8 @@
#undef JEMALLOC_EXPERIMENTAL #undef JEMALLOC_EXPERIMENTAL
/* /*
* Define overrides for non-standard allocator-related functions if they * Define overrides for non-standard allocator-related functions if they are
* are present on the system. * present on the system.
*/ */
#undef JEMALLOC_OVERRIDE_MEMALIGN #undef JEMALLOC_OVERRIDE_MEMALIGN
#undef JEMALLOC_OVERRIDE_VALLOC #undef JEMALLOC_OVERRIDE_VALLOC

View File

@ -9,20 +9,20 @@
#define JEMALLOC_VERSION_GID "@jemalloc_version_gid@" #define JEMALLOC_VERSION_GID "@jemalloc_version_gid@"
#ifdef JEMALLOC_EXPERIMENTAL #ifdef JEMALLOC_EXPERIMENTAL
#define ALLOCM_LG_ALIGN(la) (la) # define ALLOCM_LG_ALIGN(la) (la)
#if LG_SIZEOF_PTR == 2 # if LG_SIZEOF_PTR == 2
#define ALLOCM_ALIGN(a) (ffs(a)-1) # define ALLOCM_ALIGN(a) (ffs(a)-1)
#else # else
#define ALLOCM_ALIGN(a) ((a < (size_t)INT_MAX) ? ffs(a)-1 : ffs(a>>32)+31) # define ALLOCM_ALIGN(a) \
#endif ((a < (size_t)INT_MAX) ? ffs(a)-1 : ffs(a>>32)+31)
#define ALLOCM_ZERO ((int)0x40) # endif
#define ALLOCM_NO_MOVE ((int)0x80) # define ALLOCM_ZERO ((int)0x40)
# define ALLOCM_NO_MOVE ((int)0x80)
/* Bias arena index bits so that 0 encodes "ALLOCM_ARENA() unspecified". */ /* Bias arena index bits so that 0 encodes "ALLOCM_ARENA() unspecified". */
#define ALLOCM_ARENA(a) ((int)(((a)+1) << 8)) # define ALLOCM_ARENA(a) ((int)(((a)+1) << 8))
# define ALLOCM_SUCCESS 0
#define ALLOCM_SUCCESS 0 # define ALLOCM_ERR_OOM 1
#define ALLOCM_ERR_OOM 1 # define ALLOCM_ERR_NOT_MOVED 2
#define ALLOCM_ERR_NOT_MOVED 2
#endif #endif
/* /*

View File

@ -6,31 +6,31 @@
* --with-mangling and/or --with-jemalloc-prefix configuration settings. * --with-mangling and/or --with-jemalloc-prefix configuration settings.
*/ */
#ifdef JEMALLOC_MANGLE #ifdef JEMALLOC_MANGLE
#ifndef JEMALLOC_NO_DEMANGLE # ifndef JEMALLOC_NO_DEMANGLE
#define JEMALLOC_NO_DEMANGLE # define JEMALLOC_NO_DEMANGLE
#endif # endif
#define malloc_conf je_malloc_conf # define malloc_conf je_malloc_conf
#define malloc_message je_malloc_message # define malloc_message je_malloc_message
#define malloc je_malloc # define malloc je_malloc
#define calloc je_calloc # define calloc je_calloc
#define posix_memalign je_posix_memalign # define posix_memalign je_posix_memalign
#define aligned_alloc je_aligned_alloc # define aligned_alloc je_aligned_alloc
#define realloc je_realloc # define realloc je_realloc
#define free je_free # define free je_free
#define malloc_usable_size je_malloc_usable_size # define malloc_usable_size je_malloc_usable_size
#define malloc_stats_print je_malloc_stats_print # define malloc_stats_print je_malloc_stats_print
#define mallctl je_mallctl # define mallctl je_mallctl
#define mallctlnametomib je_mallctlnametomib # define mallctlnametomib je_mallctlnametomib
#define mallctlbymib je_mallctlbymib # define mallctlbymib je_mallctlbymib
#define memalign je_memalign # define memalign je_memalign
#define valloc je_valloc # define valloc je_valloc
#ifdef JEMALLOC_EXPERIMENTAL # ifdef JEMALLOC_EXPERIMENTAL
#define allocm je_allocm # define allocm je_allocm
#define rallocm je_rallocm # define rallocm je_rallocm
#define sallocm je_sallocm # define sallocm je_sallocm
#define dallocm je_dallocm # define dallocm je_dallocm
#define nallocm je_nallocm # define nallocm je_nallocm
#endif # endif
#endif #endif
/* /*
@ -41,26 +41,26 @@
* and/or --with-jemalloc-prefix. * and/or --with-jemalloc-prefix.
*/ */
#ifndef JEMALLOC_NO_DEMANGLE #ifndef JEMALLOC_NO_DEMANGLE
#undef je_malloc_conf # undef je_malloc_conf
#undef je_malloc_message # undef je_malloc_message
#undef je_malloc # undef je_malloc
#undef je_calloc # undef je_calloc
#undef je_posix_memalign # undef je_posix_memalign
#undef je_aligned_alloc # undef je_aligned_alloc
#undef je_realloc # undef je_realloc
#undef je_free # undef je_free
#undef je_malloc_usable_size # undef je_malloc_usable_size
#undef je_malloc_stats_print # undef je_malloc_stats_print
#undef je_mallctl # undef je_mallctl
#undef je_mallctlnametomib # undef je_mallctlnametomib
#undef je_mallctlbymib # undef je_mallctlbymib
#undef je_memalign # undef je_memalign
#undef je_valloc # undef je_valloc
#ifdef JEMALLOC_EXPERIMENTAL # ifdef JEMALLOC_EXPERIMENTAL
#undef je_allocm # undef je_allocm
#undef je_rallocm # undef je_rallocm
#undef je_sallocm # undef je_sallocm
#undef je_dallocm # undef je_dallocm
#undef je_nallocm # undef je_nallocm
#endif # endif
#endif #endif