Bug 1226907 - Part 2: Fix warnings in mozjemalloc and remove ALLOW_COMPILER_WARNINGS. r=glandium

This commit is contained in:
Chris Peterson 2015-11-15 13:21:56 -08:00
parent 9b4e8bae0a
commit 164d2cca6a
2 changed files with 12 additions and 4 deletions

View File

@ -435,7 +435,9 @@ static const bool isthreaded = true;
#define JEMALLOC_USES_MAP_ALIGN /* Required on Solaris 10. Might improve performance elsewhere. */
#endif
#ifndef __DECONST
#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var))
#endif
#ifdef MOZ_MEMORY_WINDOWS
/* MSVC++ does not support C99 variable-length arrays. */
@ -1607,6 +1609,12 @@ void (*_malloc_message)(const char *p1, const char *p2, const char *p3,
// Note: MozTaggedAnonymousMmap() could call an LD_PRELOADed mmap
// instead of the one defined here; use only MozTagAnonymousMemory().
#ifdef MOZ_MEMORY_ANDROID
// Android's pthread.h does not declare pthread_atfork() until SDK 21.
extern MOZ_EXPORT
int pthread_atfork(void (*)(void), void (*)(void), void(*)(void));
#endif
/* RELEASE_ASSERT calls jemalloc_crash() instead of calling MOZ_CRASH()
* directly because we want crashing to add a frame to the stack. This makes
* it easier to find the failing assertion in crash stacks. */
@ -4974,7 +4982,7 @@ arena_new(arena_t *arena)
bin->runcur = NULL;
arena_run_tree_new(&bin->runs);
bin->reg_size = (1U << (TINY_MIN_2POW + i));
bin->reg_size = (1ULL << (TINY_MIN_2POW + i));
prev_run_size = arena_bin_run_size_calc(bin, prev_run_size);

View File

@ -42,8 +42,8 @@ LOCAL_INCLUDES += [
'/memory/build',
]
# XXX: We should fix these warnings.
ALLOW_COMPILER_WARNINGS = True
if CONFIG['GNU_CC']:
CFLAGS += ['-Wshadow']
if CONFIG['_MSC_VER']:
CFLAGS += ['-wd4273'] # inconsistent dll linkage (bug 558163)