diff options
author | Robin Watts <robin.watts@artifex.com> | 2011-12-15 17:13:56 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-12-15 17:13:56 +0000 |
commit | bfc3c9a207a57651cb62cf7dc63ae3b482543f3a (patch) | |
tree | e34bf8c424c476d084a2f03caacda6dd61d2a2da /fitz/fitz.h | |
parent | b5eb1f9c93d2ea25f811b6ccc378242f1a46f19e (diff) | |
download | mupdf-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 'fitz/fitz.h')
-rw-r--r-- | fitz/fitz.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h index 81743d0a..aad4b9a2 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -525,7 +525,8 @@ void fz_drop_storable(fz_context *, fz_storable *); void fz_store_item(fz_context *ctx, fz_obj *key, void *val, unsigned int itemsize); void *fz_find_item(fz_context *ctx, fz_store_free_fn *freefn, fz_obj *key); void fz_remove_item(fz_context *ctx, fz_store_free_fn *freefn, fz_obj *key); -void fz_age_store(fz_context *ctx, int maxage); +void fz_empty_store(fz_context *ctx); +int fz_store_scavenge(fz_context *ctx, unsigned int size, int *phase); /* * Buffered reader. |