diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2011-04-08 23:20:20 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-04-08 23:20:20 +0200 |
commit | 7593da5d4b01fc638e54e295ae907b464fe00139 (patch) | |
tree | a7e8d2cfbd045c164b07504189b186dc8b1be82b /fitz/fitz.h | |
parent | 900a0de43b946152fd11a863c8d997eb928ddd55 (diff) | |
download | mupdf-7593da5d4b01fc638e54e295ae907b464fe00139.tar.xz |
Add soft limit to pixmap allocation.
All image loading functions call the new fz_new_pixmap_with_limit
allocation function, which will return NULL if the total amount of
pixmap memory would exceed a set limit. Other vital pixmap allocations
which are not as easily recoverable (such as font rendering, and the
various buffers in the draw device) ignore the limit.
Diffstat (limited to 'fitz/fitz.h')
-rw-r--r-- | fitz/fitz.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h index 111df17e..491db28b 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -680,6 +680,9 @@ struct fz_pixmap_s int free_samples; }; +/* will return NULL if soft limit is exceeded */ +fz_pixmap *fz_new_pixmap_with_limit(fz_colorspace *colorspace, int w, int h); + fz_pixmap *fz_new_pixmap_with_data(fz_colorspace *colorspace, int w, int h, unsigned char *samples); fz_pixmap *fz_new_pixmap_with_rect(fz_colorspace *, fz_bbox bbox); fz_pixmap *fz_new_pixmap(fz_colorspace *, int w, int h); |