summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2011-12-15 17:13:56 +0000
committerRobin Watts <robin.watts@artifex.com>2011-12-15 17:13:56 +0000
commitbfc3c9a207a57651cb62cf7dc63ae3b482543f3a (patch)
treee34bf8c424c476d084a2f03caacda6dd61d2a2da /apps
parentb5eb1f9c93d2ea25f811b6ccc378242f1a46f19e (diff)
downloadmupdf-bfc3c9a207a57651cb62cf7dc63ae3b482543f3a.tar.xz
Add scavenging functionality.
When fz_malloc (etc) are about to fail, we try to scavenge memory from the store and then retry. We repeatedly try to bin objects from the store until the malloc succeeds, or until we have nothing else to bin. This means we no longer need the 'aging' of the store, so this is removed.
Diffstat (limited to 'apps')
-rw-r--r--apps/pdfapp.c2
-rw-r--r--apps/pdfdraw.c2
2 files changed, 0 insertions, 4 deletions
diff --git a/apps/pdfapp.c b/apps/pdfapp.c
index c1e026fe..849b0d18 100644
--- a/apps/pdfapp.c
+++ b/apps/pdfapp.c
@@ -342,8 +342,6 @@ static void pdfapp_loadpage_pdf(pdfapp_t *app)
fz_free_device(mdev);
pdf_free_page(app->ctx, page);
-
- fz_age_store(app->ctx, 3);
}
static void pdfapp_loadpage_xps(pdfapp_t *app)
diff --git a/apps/pdfdraw.c b/apps/pdfdraw.c
index f7867bf0..1e71181e 100644
--- a/apps/pdfdraw.c
+++ b/apps/pdfdraw.c
@@ -263,8 +263,6 @@ static void drawpage(pdf_xref *xref, int pagenum)
if (showmd5 || showtime)
printf("\n");
- fz_age_store(ctx, 3);
-
fz_flush_warnings(ctx);
}