Bug 1399350 - Remove jemalloc_*_impl macros. r=njn

Those macros are one more thing that needs to be added when the
mozjemalloc API surface is increased, but after bug 1399350, nothing
actually needs them, so remove them.

--HG--
extra : rebase_source : 2bf62cc6c179540482722a72b0d0c134d2ac2a19
This commit is contained in:
Mike Hommey 2017-09-13 14:25:21 +09:00
Родитель be553422dd
Коммит 05e3823899
3 изменённых файлов: 11 добавлений и 16 удалений

Просмотреть файл

@ -5430,17 +5430,24 @@ replace_malloc_init_funcs()
/******************************************************************************/
/* Definition of all the _impl functions */
#define GENERIC_MALLOC_DECL_HELPER(name, return, return_type, ...) \
return_type name##_impl(ARGS_HELPER(TYPED_ARGS, ##__VA_ARGS__)) \
#define GENERIC_MALLOC_DECL_HELPER2(name, name_impl, return, return_type, ...) \
return_type name_impl(ARGS_HELPER(TYPED_ARGS, ##__VA_ARGS__)) \
{ \
return DefaultMalloc::name(ARGS_HELPER(ARGS, ##__VA_ARGS__)); \
}
#define GENERIC_MALLOC_DECL_HELPER(name, return, return_type, ...) \
GENERIC_MALLOC_DECL_HELPER2(name, name##_impl, return, return_type, ##__VA_ARGS__)
#define MALLOC_DECL(...) MOZ_MEMORY_API MACRO_CALL(GENERIC_MALLOC_DECL, (__VA_ARGS__))
#define MALLOC_DECL_VOID(...) MOZ_MEMORY_API MACRO_CALL(GENERIC_MALLOC_DECL_VOID, (__VA_ARGS__))
#define MALLOC_FUNCS MALLOC_FUNCS_MALLOC
#include "malloc_decls.h"
#undef GENERIC_MALLOC_DECL_HELPER
#define GENERIC_MALLOC_DECL_HELPER(name, return, return_type, ...) \
GENERIC_MALLOC_DECL_HELPER2(name, name, return, return_type, ##__VA_ARGS__)
#define MALLOC_DECL(...) MOZ_JEMALLOC_API MACRO_CALL(GENERIC_MALLOC_DECL, (__VA_ARGS__))
#define MALLOC_DECL_VOID(...) MOZ_JEMALLOC_API MACRO_CALL(GENERIC_MALLOC_DECL_VOID, (__VA_ARGS__))
#define MALLOC_FUNCS MALLOC_FUNCS_JEMALLOC

Просмотреть файл

@ -142,9 +142,6 @@
#ifndef mozmem_dup_impl
# define mozmem_dup_impl(a) a
#endif
#ifndef mozmem_jemalloc_impl
# define mozmem_jemalloc_impl(a) a
#endif
/* Malloc implementation functions */
#define malloc_impl mozmem_malloc_impl(malloc)
@ -174,13 +171,4 @@
#define asprintf_impl mozmem_dup_impl(asprintf)
#endif
/* Jemalloc specific function */
#define jemalloc_stats_impl mozmem_jemalloc_impl(jemalloc_stats)
#define jemalloc_purge_freed_pages_impl mozmem_jemalloc_impl(jemalloc_purge_freed_pages)
#define jemalloc_free_dirty_pages_impl mozmem_jemalloc_impl(jemalloc_free_dirty_pages)
#define jemalloc_thread_local_arena_impl \
mozmem_jemalloc_impl(jemalloc_thread_local_arena)
#define jemalloc_ptr_info_impl \
mozmem_jemalloc_impl(jemalloc_ptr_info)
#endif /* mozmemory_wrap_h */

Просмотреть файл

@ -280,7 +280,7 @@ MOZ_BEGIN_EXTERN_C
#include "malloc_decls.h"
#define MALLOC_DECL(name, return_type, ...) \
return_type name ## _impl(__VA_ARGS__);
return_type name(__VA_ARGS__);
#define MALLOC_FUNCS MALLOC_FUNCS_JEMALLOC
#include "malloc_decls.h"
@ -446,7 +446,7 @@ public:
die("Malformed input");
}
jemalloc_stats_t stats;
::jemalloc_stats_impl(&stats);
::jemalloc_stats(&stats);
FdPrintf(mStdErr,
"#%zu mapped: %zu; allocated: %zu; waste: %zu; dirty: %zu; "
"bookkeep: %zu; binunused: %zu\n", mOps, stats.mapped,