summaryrefslogtreecommitdiff
path: root/memory/mozjemalloc
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-11-30 17:32:36 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-11-30 17:32:36 +0100
commit90508a4648f6103bc5a5b6df2f67e8bddc6fbb47 (patch)
treebcd2ba627307701138db162d9197663ab14947bc /memory/mozjemalloc
parentb4b589a11875ed290d8b632c7a69b89b293f864c (diff)
downloaduxp-90508a4648f6103bc5a5b6df2f67e8bddc6fbb47.tar.gz
Issue #1307 - Part 5: Remove allocation tracing.
Pointless for debugging and a major performance sink.
Diffstat (limited to 'memory/mozjemalloc')
-rw-r--r--memory/mozjemalloc/jemalloc.c97
-rw-r--r--memory/mozjemalloc/jemalloc_types.h3
2 files changed, 1 insertions, 99 deletions
diff --git a/memory/mozjemalloc/jemalloc.c b/memory/mozjemalloc/jemalloc.c
index c46e3c047f..cef42e79f2 100644
--- a/memory/mozjemalloc/jemalloc.c
+++ b/memory/mozjemalloc/jemalloc.c
@@ -167,11 +167,6 @@
*/
# define MALLOC_DEBUG
- /* Allocation tracing. */
-# ifndef MOZ_MEMORY_WINDOWS
-# define MALLOC_UTRACE
-# endif
-
/* Support optional abort() on OOM. */
# define MALLOC_XMALLOC
@@ -1139,9 +1134,6 @@ static size_t opt_quantum_2pow = QUANTUM_2POW_MIN;
static size_t opt_small_max_2pow = SMALL_MAX_2POW_DEFAULT;
static size_t opt_chunk_2pow = CHUNK_2POW_DEFAULT;
#endif
-#ifdef MALLOC_UTRACE
-static bool opt_utrace = false;
-#endif
#ifdef MALLOC_SYSV
static bool opt_sysv = false;
#endif
@@ -1150,25 +1142,6 @@ static bool opt_xmalloc = false;
#endif
static int opt_narenas_lshift = 0;
-#ifdef MALLOC_UTRACE
-typedef struct {
- void *p;
- size_t s;
- void *r;
-} malloc_utrace_t;
-
-#define UTRACE(a, b, c) \
- if (opt_utrace) { \
- malloc_utrace_t ut; \
- ut.p = (a); \
- ut.s = (b); \
- ut.r = (c); \
- utrace(&ut, sizeof(ut)); \
- }
-#else
-#define UTRACE(a, b, c)
-#endif
-
/******************************************************************************/
/*
* Begin function prototypes for non-inline static functions.
@@ -1595,52 +1568,6 @@ pow2_ceil(size_t x)
return (x);
}
-#ifdef MALLOC_UTRACE
-static int
-utrace(const void *addr, size_t len)
-{
- malloc_utrace_t *ut = (malloc_utrace_t *)addr;
- char buf_a[UMAX2S_BUFSIZE];
- char buf_b[UMAX2S_BUFSIZE];
-
- assert(len == sizeof(malloc_utrace_t));
-
- if (ut->p == NULL && ut->s == 0 && ut->r == NULL) {
- _malloc_message(
- umax2s(getpid(), 10, buf_a),
- " x USER malloc_init()\n", "", "");
- } else if (ut->p == NULL && ut->r != NULL) {
- _malloc_message(
- umax2s(getpid(), 10, buf_a),
- " x USER 0x",
- umax2s((uintptr_t)ut->r, 16, buf_b),
- " = malloc(");
- _malloc_message(
- umax2s(ut->s, 10, buf_a),
- ")\n", "", "");
- } else if (ut->p != NULL && ut->r != NULL) {
- _malloc_message(
- umax2s(getpid(), 10, buf_a),
- " x USER 0x",
- umax2s((uintptr_t)ut->r, 16, buf_b),
- " = realloc(0x");
- _malloc_message(
- umax2s((uintptr_t)ut->p, 16, buf_a),
- ", ",
- umax2s(ut->s, 10, buf_b),
- ")\n");
- } else {
- _malloc_message(
- umax2s(getpid(), 10, buf_a),
- " x USER free(0x",
- umax2s((uintptr_t)ut->p, 16, buf_b),
- ")\n");
- }
-
- return (0);
-}
-#endif
-
static inline const char *
_getprogname(void)
{
@@ -4969,9 +4896,6 @@ malloc_print_stats(void)
_malloc_message(opt_junk ? "J" : "j", "", "", "");
#endif
_malloc_message("P", "", "", "");
-#ifdef MALLOC_UTRACE
- _malloc_message(opt_utrace ? "U" : "u", "", "", "");
-#endif
#ifdef MALLOC_SYSV
_malloc_message(opt_sysv ? "V" : "v", "", "", "");
#endif
@@ -5323,14 +5247,6 @@ MALLOC_OUT:
opt_small_max_2pow++;
break;
#endif
-#ifdef MALLOC_UTRACE
- case 'u':
- opt_utrace = false;
- break;
- case 'U':
- opt_utrace = true;
- break;
-#endif
#ifdef MALLOC_SYSV
case 'v':
opt_sysv = false;
@@ -5425,8 +5341,6 @@ MALLOC_OUT:
assert((1 << (ffs(chunksize / pagesize) - 1)) == (chunksize/pagesize));
#endif
- UTRACE(0, 0, 0);
-
/* Various sanity checks that regard configuration. */
assert(quantum >= sizeof(void *));
assert(quantum <= pagesize);
@@ -5700,7 +5614,6 @@ RETURN:
errno = ENOMEM;
}
- UTRACE(0, size, ret);
return (ret);
}
@@ -5778,7 +5691,6 @@ RETURN:
abort();
}
#endif
- UTRACE(0, size, ret);
return (ret);
}
@@ -5892,7 +5804,6 @@ RETURN:
errno = ENOMEM;
}
- UTRACE(0, num_size, ret);
return (ret);
}
@@ -5956,7 +5867,6 @@ realloc_impl(void *ptr, size_t size)
#ifdef MALLOC_SYSV
RETURN:
#endif
- UTRACE(ptr, size, ret);
return (ret);
}
@@ -5967,8 +5877,6 @@ free_impl(void *ptr)
DARWIN_ONLY((szone->free)(szone, ptr); return);
- UTRACE(ptr, 0, 0);
-
/*
* A version of idalloc that checks for NULL pointer but only for
* huge allocations assuming that CHUNK_ADDR2OFFSET(NULL) == 0.
@@ -6063,11 +5971,6 @@ jemalloc_stats_impl(jemalloc_stats_t *stats)
opt_poison ? true :
#endif
false;
- stats->opt_utrace =
-#ifdef MALLOC_UTRACE
- opt_utrace ? true :
-#endif
- false;
stats->opt_sysv =
#ifdef MALLOC_SYSV
opt_sysv ? true :
diff --git a/memory/mozjemalloc/jemalloc_types.h b/memory/mozjemalloc/jemalloc_types.h
index 96165ae4d0..dc778ae0a7 100644
--- a/memory/mozjemalloc/jemalloc_types.h
+++ b/memory/mozjemalloc/jemalloc_types.h
@@ -2,7 +2,7 @@
/* vim:set softtabstop=8 shiftwidth=8: */
/*-
* Copyright (C) 2006-2008 Jason Evans <jasone@FreeBSD.org>.
- * Copyright (C) 2015-2018 Mark Straver <moonchild@palemoon.org>
+ * Copyright (C) 2015-2019 Mark Straver <moonchild@palemoon.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -57,7 +57,6 @@ typedef struct {
jemalloc_bool opt_abort; /* abort(3) on error? */
jemalloc_bool opt_junk; /* Fill allocated memory with 0xe4? */
jemalloc_bool opt_poison; /* Fill free memory with 0xe5? */
- jemalloc_bool opt_utrace; /* Trace all allocation events? */
jemalloc_bool opt_sysv; /* SysV semantics? */
jemalloc_bool opt_xmalloc; /* abort(3) on OOM? */
jemalloc_bool opt_zero; /* Fill allocated memory with 0x0? */