Skip to content

Commit

Permalink
Remove extraneous parens around return arguments.
Browse files Browse the repository at this point in the history
This resolves #540.
  • Loading branch information
jasone committed Jan 21, 2017
1 parent c4c2592 commit f408643
Show file tree
Hide file tree
Showing 104 changed files with 1,161 additions and 1,168 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ if test "x$enable_cxx" = "x1" ; then
], [[
int *arr = (int *)malloc(sizeof(int) * 42);
if (arr == NULL)
return (1);
return 1;
]], [je_cv_libstdcxx])
if test "x${je_cv_libstdcxx}" = "xno" ; then
LIBS="${SAVED_LIBS}"
Expand Down Expand Up @@ -1659,7 +1659,7 @@ JE_COMPILABLE([C11 atomics], [
uint64_t x = 1;
volatile atomic_uint_least64_t *a = (volatile atomic_uint_least64_t *)p;
uint64_t r = atomic_fetch_add(a, x) + x;
return (r == 0);
return r == 0;
], [je_cv_c11atomics])
if test "x${je_cv_c11atomics}" = "xyes" ; then
AC_DEFINE([JEMALLOC_C11ATOMICS])
Expand Down
16 changes: 8 additions & 8 deletions include/jemalloc/internal/arena_inlines_a.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bool arena_prof_accum(tsdn_t *tsdn, arena_t *arena, uint64_t accumbytes);

JEMALLOC_INLINE unsigned
arena_ind_get(const arena_t *arena) {
return (base_ind_get(arena->base));
return base_ind_get(arena->base);
}

JEMALLOC_INLINE void
Expand All @@ -30,7 +30,7 @@ arena_internal_sub(arena_t *arena, size_t size) {

JEMALLOC_INLINE size_t
arena_internal_get(arena_t *arena) {
return (atomic_read_zu(&arena->stats.internal));
return atomic_read_zu(&arena->stats.internal);
}

JEMALLOC_INLINE bool
Expand All @@ -41,27 +41,27 @@ arena_prof_accum_impl(arena_t *arena, uint64_t accumbytes) {
arena->prof_accumbytes += accumbytes;
if (arena->prof_accumbytes >= prof_interval) {
arena->prof_accumbytes %= prof_interval;
return (true);
return true;
}
return (false);
return false;
}

JEMALLOC_INLINE bool
arena_prof_accum_locked(arena_t *arena, uint64_t accumbytes) {
cassert(config_prof);

if (likely(prof_interval == 0)) {
return (false);
return false;
}
return (arena_prof_accum_impl(arena, accumbytes));
return arena_prof_accum_impl(arena, accumbytes);
}

JEMALLOC_INLINE bool
arena_prof_accum(tsdn_t *tsdn, arena_t *arena, uint64_t accumbytes) {
cassert(config_prof);

if (likely(prof_interval == 0)) {
return (false);
return false;
}

{
Expand All @@ -70,7 +70,7 @@ arena_prof_accum(tsdn_t *tsdn, arena_t *arena, uint64_t accumbytes) {
malloc_mutex_lock(tsdn, &arena->lock);
ret = arena_prof_accum_impl(arena, accumbytes);
malloc_mutex_unlock(tsdn, &arena->lock);
return (ret);
return ret;
}
}

Expand Down
20 changes: 10 additions & 10 deletions include/jemalloc/internal/arena_inlines_b.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ JEMALLOC_INLINE szind_t
arena_bin_index(arena_t *arena, arena_bin_t *bin) {
szind_t binind = (szind_t)(bin - arena->bins);
assert(binind < NBINS);
return (binind);
return binind;
}

JEMALLOC_INLINE prof_tctx_t *
Expand All @@ -35,9 +35,9 @@ arena_prof_tctx_get(tsdn_t *tsdn, const extent_t *extent, const void *ptr) {
assert(ptr != NULL);

if (unlikely(!extent_slab_get(extent))) {
return (large_prof_tctx_get(tsdn, extent));
return large_prof_tctx_get(tsdn, extent);
}
return ((prof_tctx_t *)(uintptr_t)1U);
return (prof_tctx_t *)(uintptr_t)1U;
}

JEMALLOC_INLINE void
Expand Down Expand Up @@ -94,23 +94,23 @@ arena_malloc(tsdn_t *tsdn, arena_t *arena, size_t size, szind_t ind, bool zero,

if (likely(tcache != NULL)) {
if (likely(size <= SMALL_MAXCLASS)) {
return (tcache_alloc_small(tsdn_tsd(tsdn), arena,
tcache, size, ind, zero, slow_path));
return tcache_alloc_small(tsdn_tsd(tsdn), arena,
tcache, size, ind, zero, slow_path);
}
if (likely(size <= tcache_maxclass)) {
return (tcache_alloc_large(tsdn_tsd(tsdn), arena,
tcache, size, ind, zero, slow_path));
return tcache_alloc_large(tsdn_tsd(tsdn), arena,
tcache, size, ind, zero, slow_path);
}
/* (size > tcache_maxclass) case falls through. */
assert(size > tcache_maxclass);
}

return (arena_malloc_hard(tsdn, arena, size, ind, zero));
return arena_malloc_hard(tsdn, arena, size, ind, zero);
}

JEMALLOC_ALWAYS_INLINE arena_t *
arena_aalloc(tsdn_t *tsdn, const void *ptr) {
return (extent_arena_get(iealloc(tsdn, ptr)));
return extent_arena_get(iealloc(tsdn, ptr));
}

/* Return the size of the allocation pointed to by ptr. */
Expand All @@ -126,7 +126,7 @@ arena_salloc(tsdn_t *tsdn, const extent_t *extent, const void *ptr) {
ret = large_salloc(tsdn, extent);
}

return (ret);
return ret;
}

JEMALLOC_ALWAYS_INLINE void
Expand Down
Loading

0 comments on commit f408643

Please sign in to comment.