summaryrefslogtreecommitdiff
path: root/www/firefox-esr/files/patch-z-bug762445
diff options
context:
space:
mode:
authorFlorian Smeets <flo@FreeBSD.org>2013-01-10 22:29:23 +0000
committerFlorian Smeets <flo@FreeBSD.org>2013-01-10 22:29:23 +0000
commite676e2910f592704af67424758ebd4cfdff9ebcd (patch)
treedd14b47bf2d53036668a1976cb68d74952705242 /www/firefox-esr/files/patch-z-bug762445
parent- bump PORTREVISION since shlib version of gflags was changed (diff)
- update www/firefox to 18.0
- update www/firefox-esr to 17.0.2 - update www/seamonkey to 2.15 (enigmail to 1.5.0) - remove QT4 option to avoid confusion (it turned out to be too experimental) In collaboration with: Jan Beich <jbeich@tormail.org> Security: http://www.vuxml.org/freebsd/a4ed6632-5aa9-11e2-8fcb-c8600054b392.html
Diffstat (limited to 'www/firefox-esr/files/patch-z-bug762445')
-rw-r--r--www/firefox-esr/files/patch-z-bug76244570
1 files changed, 70 insertions, 0 deletions
diff --git a/www/firefox-esr/files/patch-z-bug762445 b/www/firefox-esr/files/patch-z-bug762445
new file mode 100644
index 000000000000..fd42fea9cab2
--- /dev/null
+++ b/www/firefox-esr/files/patch-z-bug762445
@@ -0,0 +1,70 @@
+commit b44dc8e
+Author: Jan Beich <jbeich@tormail.org>
+Date: Fri Oct 12 18:49:59 2012 +0000
+
+ Bug 762445 - Add jemalloc3 glue for heap-committed, heap-dirty in about:memory.
+---
+ memory/build/mozjemalloc_compat.c | 34 ++++++++++++++++++++++++++++------
+ 1 file changed, 28 insertions(+), 6 deletions(-)
+
+diff --git memory/build/mozjemalloc_compat.c memory/build/mozjemalloc_compat.c
+index 94ad96e..7adfef5 100644
+--- memory/build/mozjemalloc_compat.c
++++ memory/build/mozjemalloc_compat.c
+@@ -11,15 +11,50 @@
+ #define wrap(a) je_ ## a
+ #endif
+
+-extern MOZ_IMPORT_API(int)
++/*
++ * CTL_* macros are from memory/jemalloc/src/src/stats.c with changes:
++ * - drop `t' argument to avoid redundancy in calculating type size
++ * - require `i' argument for arena number explicitly
++ */
++
++#define CTL_GET(n, v) do { \
++ size_t sz = sizeof(v); \
++ wrap(mallctl)(n, &v, &sz, NULL, 0); \
++} while (0)
++
++#define CTL_I_GET(n, v, i) do { \
++ size_t mib[6]; \
++ size_t miblen = sizeof(mib) / sizeof(mib[0]); \
++ size_t sz = sizeof(v); \
++ wrap(mallctlnametomib)(n, mib, &miblen); \
++ mib[2] = i; \
++ wrap(mallctlbymib)(mib, miblen, &v, &sz, NULL, 0); \
++} while (0)
++
++MOZ_IMPORT_API(int)
+ wrap(mallctl)(const char*, void*, size_t*, void*, size_t);
++MOZ_IMPORT_API(int)
++wrap(mallctlnametomib)(const char *name, size_t *mibp, size_t *miblenp);
++MOZ_IMPORT_API(int)
++wrap(mallctlbymib)(const size_t *mib, size_t miblen, void *oldp, size_t *oldlenp, void *newp, size_t newlen);
+
+ MOZ_EXPORT_API(void)
+ jemalloc_stats(jemalloc_stats_t *stats)
+ {
+- size_t size = sizeof(stats->mapped);
+- wrap(mallctl)("stats.mapped", &stats->mapped, &size, NULL, 0);
+- wrap(mallctl)("stats.allocated", &stats->allocated, &size, NULL, 0);
+- stats->committed = -1;
+- stats->dirty = -1;
++ unsigned narenas;
++ size_t active, allocated, mapped, page, pdirty;
++
++ CTL_GET("arenas.narenas", narenas);
++ CTL_GET("arenas.page", page);
++ CTL_GET("stats.active", active);
++ CTL_GET("stats.allocated", allocated);
++ CTL_GET("stats.mapped", mapped);
++
++ /* get the summation for all arenas, i == narenas */
++ CTL_I_GET("stats.arenas.0.pdirty", pdirty, narenas);
++
++ stats->allocated = allocated;
++ stats->mapped = mapped;
++ stats->dirty = pdirty * page;
++ stats->committed = active + stats->dirty;
+ }