From 73867ca96bbd6f45ffafde234c22cbcf0489ea57 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 26 Mar 2018 17:27:43 +0100 Subject: Android: Scavenge on Bitmap.lockPixels() failure. If Bitmap.lockPixels fails with an allocation error, scavenge in the store. --- include/mupdf/fitz/store.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/mupdf/fitz/store.h b/include/mupdf/fitz/store.h index 5b048ed0..7dff6c30 100644 --- a/include/mupdf/fitz/store.h +++ b/include/mupdf/fitz/store.h @@ -242,6 +242,18 @@ void fz_empty_store(fz_context *ctx); */ int fz_store_scavenge(fz_context *ctx, size_t size, int *phase); +/* + fz_store_scavenge_external: External function for callers to use + to scavenge while trying allocations. + + size: The number of bytes we are trying to have free. + + phase: What phase of the scavenge we are in. Updated on exit. + + Returns non zero if we managed to free any memory. +*/ +int fz_store_scavenge_external(fz_context *ctx, size_t size, int *phase); + /* fz_shrink_store: Evict items from the store until the total size of the objects in the store is reduced to a given percentage of its -- cgit v1.2.3