summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2015-09-21 18:53:00 (GMT)
committerJason Evans <jasone@canonware.com>2015-09-21 18:53:00 (GMT)
commit486d249fb4715fd3de679b6c2a04f7e657883111 (patch)
treef6f9e9644f4fde5f36ca57f6c1b43d6567b1bf3b /src
parent9898051fd16ebd5d29dc27aae5e069fe04486ff3 (diff)
parentb8e966f121e55ffa0c904f9ff7d419797b872aa8 (diff)
downloadjemalloc-4.0.2.zip
jemalloc-4.0.2.tar.gz
jemalloc-4.0.2.tar.bz2
Merge branch 'dev'4.0.2
Diffstat (limited to 'src')
-rw-r--r--src/arena.c2
-rw-r--r--src/jemalloc.c72
-rw-r--r--src/prof.c2
3 files changed, 26 insertions, 50 deletions
diff --git a/src/arena.c b/src/arena.c
index 2e888ea..7f4a6ca 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -2560,7 +2560,7 @@ arena_dalloc_junk_large_t *arena_dalloc_junk_large =
JEMALLOC_N(arena_dalloc_junk_large_impl);
#endif
-void
+static void
arena_dalloc_large_locked_impl(arena_t *arena, arena_chunk_t *chunk,
void *ptr, bool junked)
{
diff --git a/src/jemalloc.c b/src/jemalloc.c
index ab7cf02..5a2d324 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -1923,6 +1923,7 @@ imallocx_flags_decode_hard(tsd_t *tsd, size_t size, int flags, size_t *usize,
*alignment = MALLOCX_ALIGN_GET_SPECIFIED(flags);
*usize = sa2u(size, *alignment);
}
+ assert(*usize != 0);
*zero = MALLOCX_ZERO_GET(flags);
if ((flags & MALLOCX_TCACHE_MASK) != 0) {
if ((flags & MALLOCX_TCACHE_MASK) == MALLOCX_TCACHE_NONE)
@@ -1965,41 +1966,29 @@ imallocx_flags(tsd_t *tsd, size_t usize, size_t alignment, bool zero,
tcache_t *tcache, arena_t *arena)
{
- if (alignment != 0)
+ if (unlikely(alignment != 0))
return (ipalloct(tsd, usize, alignment, zero, tcache, arena));
- if (zero)
+ if (unlikely(zero))
return (icalloct(tsd, usize, tcache, arena));
return (imalloct(tsd, usize, tcache, arena));
}
-JEMALLOC_ALWAYS_INLINE_C void *
-imallocx_maybe_flags(tsd_t *tsd, size_t size, int flags, size_t usize,
- size_t alignment, bool zero, tcache_t *tcache, arena_t *arena)
-{
-
- if (likely(flags == 0))
- return (imalloc(tsd, size));
- return (imallocx_flags(tsd, usize, alignment, zero, tcache, arena));
-}
-
static void *
-imallocx_prof_sample(tsd_t *tsd, size_t size, int flags, size_t usize,
- size_t alignment, bool zero, tcache_t *tcache, arena_t *arena)
+imallocx_prof_sample(tsd_t *tsd, size_t usize, size_t alignment, bool zero,
+ tcache_t *tcache, arena_t *arena)
{
void *p;
if (usize <= SMALL_MAXCLASS) {
assert(((alignment == 0) ? s2u(LARGE_MINCLASS) :
sa2u(LARGE_MINCLASS, alignment)) == LARGE_MINCLASS);
- p = imallocx_maybe_flags(tsd, LARGE_MINCLASS, flags,
- LARGE_MINCLASS, alignment, zero, tcache, arena);
+ p = imallocx_flags(tsd, LARGE_MINCLASS, alignment, zero, tcache,
+ arena);
if (p == NULL)
return (NULL);
arena_prof_promoted(p, usize);
- } else {
- p = imallocx_maybe_flags(tsd, size, flags, usize, alignment,
- zero, tcache, arena);
- }
+ } else
+ p = imallocx_flags(tsd, usize, alignment, zero, tcache, arena);
return (p);
}
@@ -2018,12 +2007,11 @@ imallocx_prof(tsd_t *tsd, size_t size, int flags, size_t *usize)
&zero, &tcache, &arena)))
return (NULL);
tctx = prof_alloc_prep(tsd, *usize, prof_active_get_unlocked(), true);
- if (likely((uintptr_t)tctx == (uintptr_t)1U)) {
- p = imallocx_maybe_flags(tsd, size, flags, *usize, alignment,
- zero, tcache, arena);
- } else if ((uintptr_t)tctx > (uintptr_t)1U) {
- p = imallocx_prof_sample(tsd, size, flags, *usize, alignment,
- zero, tcache, arena);
+ if (likely((uintptr_t)tctx == (uintptr_t)1U))
+ p = imallocx_flags(tsd, *usize, alignment, zero, tcache, arena);
+ else if ((uintptr_t)tctx > (uintptr_t)1U) {
+ p = imallocx_prof_sample(tsd, *usize, alignment, zero, tcache,
+ arena);
} else
p = NULL;
if (unlikely(p == NULL)) {
@@ -2098,8 +2086,8 @@ label_oom:
}
static void *
-irallocx_prof_sample(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t size,
- size_t alignment, size_t usize, bool zero, tcache_t *tcache, arena_t *arena,
+irallocx_prof_sample(tsd_t *tsd, void *old_ptr, size_t old_usize,
+ size_t usize, size_t alignment, bool zero, tcache_t *tcache, arena_t *arena,
prof_tctx_t *tctx)
{
void *p;
@@ -2113,7 +2101,7 @@ irallocx_prof_sample(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t size,
return (NULL);
arena_prof_promoted(p, usize);
} else {
- p = iralloct(tsd, old_ptr, old_usize, size, alignment, zero,
+ p = iralloct(tsd, old_ptr, old_usize, usize, alignment, zero,
tcache, arena);
}
@@ -2133,8 +2121,8 @@ irallocx_prof(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t size,
old_tctx = prof_tctx_get(old_ptr);
tctx = prof_alloc_prep(tsd, *usize, prof_active, true);
if (unlikely((uintptr_t)tctx != (uintptr_t)1U)) {
- p = irallocx_prof_sample(tsd, old_ptr, old_usize, size,
- alignment, *usize, zero, tcache, arena, tctx);
+ p = irallocx_prof_sample(tsd, old_ptr, old_usize, *usize,
+ alignment, zero, tcache, arena, tctx);
} else {
p = iralloct(tsd, old_ptr, old_usize, size, alignment, zero,
tcache, arena);
@@ -2251,26 +2239,13 @@ ixallocx_helper(void *ptr, size_t old_usize, size_t size, size_t extra,
static size_t
ixallocx_prof_sample(void *ptr, size_t old_usize, size_t size, size_t extra,
- size_t alignment, size_t usize_max, bool zero, prof_tctx_t *tctx)
+ size_t alignment, bool zero, prof_tctx_t *tctx)
{
size_t usize;
if (tctx == NULL)
return (old_usize);
- /* Use minimum usize to determine whether promotion may happen. */
- if (((alignment == 0) ? s2u(size) : sa2u(size, alignment)) <=
- SMALL_MAXCLASS) {
- if (ixalloc(ptr, old_usize, SMALL_MAXCLASS+1,
- (SMALL_MAXCLASS+1 >= size+extra) ? 0 : size+extra -
- (SMALL_MAXCLASS+1), alignment, zero))
- return (old_usize);
- usize = isalloc(ptr, config_prof);
- if (usize_max < LARGE_MINCLASS)
- arena_prof_promoted(ptr, usize);
- } else {
- usize = ixallocx_helper(ptr, old_usize, size, extra, alignment,
- zero);
- }
+ usize = ixallocx_helper(ptr, old_usize, size, extra, alignment, zero);
return (usize);
}
@@ -2293,15 +2268,16 @@ ixallocx_prof(tsd_t *tsd, void *ptr, size_t old_usize, size_t size,
*/
usize_max = (alignment == 0) ? s2u(size+extra) : sa2u(size+extra,
alignment);
+ assert(usize_max != 0);
tctx = prof_alloc_prep(tsd, usize_max, prof_active, false);
if (unlikely((uintptr_t)tctx != (uintptr_t)1U)) {
usize = ixallocx_prof_sample(ptr, old_usize, size, extra,
- alignment, usize_max, zero, tctx);
+ alignment, zero, tctx);
} else {
usize = ixallocx_helper(ptr, old_usize, size, extra, alignment,
zero);
}
- if (unlikely(usize == old_usize)) {
+ if (usize == old_usize) {
prof_alloc_rollback(tsd, tctx, false);
return (usize);
}
diff --git a/src/prof.c b/src/prof.c
index d68478f..0a08062 100644
--- a/src/prof.c
+++ b/src/prof.c
@@ -209,7 +209,7 @@ prof_alloc_rollback(tsd_t *tsd, prof_tctx_t *tctx, bool updated)
*/
tdata = prof_tdata_get(tsd, true);
if (tdata != NULL)
- prof_sample_threshold_update(tctx->tdata);
+ prof_sample_threshold_update(tdata);
}
if ((uintptr_t)tctx > (uintptr_t)1U) {
pkg_migration'>dgp_pkg_migration Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful.
summaryrefslogtreecommitdiffstats
path: root/tests
ModeNameSize
-rw-r--r--README4471logstatsplain
-rw-r--r--all.tcl613logstatsplain
-rw-r--r--append.test6412logstatsplain
-rw-r--r--appendComp.test8873logstatsplain
-rw-r--r--assocd.test2108logstatsplain
-rw-r--r--async.test6005logstatsplain
-rw-r--r--autoMkindex.test10619logstatsplain
-rw-r--r--basic.test31394logstatsplain
-rw-r--r--binary.test74306logstatsplain
-rw-r--r--case.test3014logstatsplain
-rw-r--r--chan.test3800logstatsplain
-rw-r--r--clock.test1831973logstatsplain
-rw-r--r--cmdAH.test50840logstatsplain
-rw-r--r--cmdIL.test23981logstatsplain
-rw-r--r--cmdInfo.test3692logstatsplain
-rw-r--r--cmdMZ.test12046logstatsplain
-rw-r--r--compExpr-old.test39362logstatsplain
-rw-r--r--compExpr.test16160logstatsplain
-rw-r--r--compile.test20322logstatsplain
-rw-r--r--concat.test1610logstatsplain
-rw-r--r--config.test2321logstatsplain
-rw-r--r--dcall.test1397logstatsplain
-rw-r--r--dict.test35006logstatsplain
-rw-r--r--dstring.test10198logstatsplain
-rw-r--r--encoding.test18320logstatsplain
-rw-r--r--env.test6816logstatsplain
-rw-r--r--error.test6393logstatsplain
-rw-r--r--eval.test1690logstatsplain
-rw-r--r--event.test17420logstatsplain
-rw-r--r--exec.test23170logstatsplain
-rw-r--r--execute.test25269logstatsplain
-rw-r--r--expr-old.test44516logstatsplain
-rw-r--r--expr.test283871logstatsplain
-rw-r--r--fCmd.test78744logstatsplain
-rw-r--r--fileName.test52970logstatsplain
-rw-r--r--fileSystem.test32226logstatsplain
-rw-r--r--for-old.test2009logstatsplain
-rw-r--r--for.test23837logstatsplain
-rw-r--r--foreach.test6237logstatsplain
-rw-r--r--format.test19237logstatsplain
-rw-r--r--get.test4617logstatsplain
-rw-r--r--history.test8044logstatsplain
-rw-r--r--http.test15567logstatsplain
-rw-r--r--httpd5324logstatsplain
-rw-r--r--httpold.test7917logstatsplain
-rw-r--r--if-old.test4836logstatsplain
-rw-r--r--if.test27408logstatsplain
-rw-r--r--incr-old.test3035logstatsplain
-rw-r--r--incr.test17716logstatsplain
-rw-r--r--indexObj.test4297logstatsplain
-rw-r--r--info.test20605logstatsplain
-rw-r--r--init.test6375logstatsplain
-rw-r--r--interp.test91418logstatsplain
-rw-r--r--io.test205741logstatsplain