summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2014-06-06 19:11:54 +0200
committerCarlos Garcia Campos <carlosgc@gnome.org>2014-06-06 19:11:54 +0200
commit15bd5c87ea850423ad21c08b03cb20cd8010b855 (patch)
treefc744f4534508c4e755c219f6487f18ef166c1bb
parent9669c347c892676e956c7b002bd68b524412a032 (diff)
Report maximum memory in use in gMemReport()
-rw-r--r--ALL_DIFF24
1 files changed, 0 insertions, 24 deletions
diff --git a/ALL_DIFF b/ALL_DIFF
index 601a796..4286357 100644
--- a/ALL_DIFF
+++ b/ALL_DIFF
@@ -6392,14 +6392,6 @@ diff -uNrp xpdf-3.03/goo/gfile.h xpdf-3.04/goo/gfile.h
diff -uNrp xpdf-3.03/goo/gmem.cc xpdf-3.04/goo/gmem.cc
--- xpdf-3.03/goo/gmem.cc 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/goo/gmem.cc 2014-05-28 20:50:50.000000000 +0200
-@@ -44,6 +44,7 @@ static GMemHdr *gMemTail = NULL;
- static int gMemIndex = 0;
- static int gMemAlloc = 0;
- static int gMemInUse = 0;
-+static int gMaxMemInUse = 0;
-
- #endif /* DEBUG_MEM */
-
@@ -56,24 +57,14 @@ void *gmalloc(int size) GMEM_EXCEP {
unsigned long *trl, *p;
@@ -6427,16 +6419,6 @@ diff -uNrp xpdf-3.03/goo/gmem.cc xpdf-3.04/goo/gmem.cc
}
hdr = (GMemHdr *)mem;
data = (void *)(mem + gMemHdrSize);
-@@ -92,6 +83,9 @@ void *gmalloc(int size) GMEM_EXCEP {
- hdr->next = NULL;
- ++gMemAlloc;
- gMemInUse += size;
-+ if (gMemInUse > gMaxMemInUse) {
-+ gMaxMemInUse = gMemInUse;
-+ }
- for (p = (unsigned long *)data; p <= trl; ++p) {
- *p = gMemDeadVal;
- }
@@ -100,23 +94,13 @@ void *gmalloc(int size) GMEM_EXCEP {
void *p;
@@ -6549,12 +6531,6 @@ diff -uNrp xpdf-3.03/goo/gmem.cc xpdf-3.04/goo/gmem.cc
#ifdef DEBUG_MEM
void gMemReport(FILE *f) {
GMemHdr *p;
-
- fprintf(f, "%d memory allocations in all\n", gMemIndex);
-+ fprintf(f, "maximum memory in use: %d bytes\n", gMaxMemInUse);
- if (gMemAlloc > 0) {
- fprintf(f, "%d memory blocks left allocated:\n", gMemAlloc);
- fprintf(f, " index size\n");
diff -uNrp xpdf-3.03/goo/gmem.h xpdf-3.04/goo/gmem.h
--- xpdf-3.03/goo/gmem.h 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/goo/gmem.h 2014-05-28 20:50:50.000000000 +0200