summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-12-22Fix Bug 692756: SEGVs in pdf_annot and pdf_outlineRobin Watts
A couple of bits of the code SEGV in the event that values are NULL. Fixed here by converting a do...while to a while, and adding an extra guard in the if. Thanks to Gaetan Bisson for the report, and patch.
2011-12-22More MemSqueezing fixes.Robin Watts
2011-12-21Fix whitespace.Tor Andersson
2011-12-21Bring the Android demo port up to date.Robin Watts
Hadn't been updated to allow for context/exceptions.
2011-12-20More memsqueezing fixes.Robin Watts
One of the previous memsqueezing fixes (specifically that in close_dctd) appears to cause the Memento fork bases squeezing process to stop. This appears to be because old code would do a NULL dereference causing a SEGV. This would somehow NOT be picked up by the signal handler, and the child would exit. If the code is fixed to avoid the SEGV the code then somehow goes on to do something (not in the close_dctd code) that makes the mem squeeze process grind to a halt - but NOT in the same instance of the executable. I am at a loss to explain this, but would rather the code stays as it is (being as far as I can see correct) for now.
2011-12-19More memsqueezing fixes.Robin Watts
2011-12-19Add Memento 'pattern' code.Robin Watts
Disabled for now by default. Better SEGV handling under windows (to facilitate scripted squeezing)
2011-12-19More Memory squeezing fixesRobin Watts
2011-12-19Removed unused variable.Robin Watts
2011-12-17More memsqueezing fixes.Robin Watts
2011-12-17More Memory Squeezing fixes.Robin Watts
2011-12-17Memory squeezing fixRobin Watts
2011-12-17More memsqueezing fixes; stream creation.Robin Watts
2011-12-17Change stream 'close' functions to facilitate error cleanup.Robin Watts
Rather than passing a stream to a close function, just pass context and state - that's all that is required. This enables us to call close to cleanup neatly if the stream fails to allocate.
2011-12-16More memsqueezing fixes.Robin Watts
2011-12-16Increase amount to search in blocks for nestings in memento.Robin Watts
Mupdf has some large structures (fz_shade is over 32K!), so to catch all pointers we need to search further than the 1K I was originally limiting ourselves to.
2011-12-16More MemSqueezing fixes.Robin Watts
2011-12-16Fix another Memento_label warning.Robin Watts
Missed this one last time.
2011-12-16More memsqueezing fixes.Robin Watts
2011-12-16More memsqueezing fixes.Robin Watts
2011-12-16Fix Memento_label related warnings in non-memento builds.Robin Watts
2011-12-16Mote memsqueezing fixes.Robin Watts
2011-12-16Add fz_malloc_struct, and make code use it.Robin Watts
The new fz_malloc_struct(A,B) macro allocates sizeof(B) bytes using fz_malloc, and then passes the resultant pointer to Memento_label to label it with "B". This costs nothing in non-memento builds, but gives much nicer listings of leaked blocks when memento is enabled.
2011-12-16Another memsqueezing fix.Robin Watts
2011-12-16New Memento features; nesting of listed blocks, labelling of blocksRobin Watts
When listing blocks from Memento, look for internal pointers to other blocks, and use this to generate a nested list - much easier to read when looking to see which stray reference is causing blocks to leak. Add new Memento_label feature to allow blocks to be labelled. Makes block displaying much easier to read.
2011-12-16More memsqueezing fixesRobin Watts
2011-12-15More Memsqueezing fixes.Robin Watts
2011-12-15Another memsqueezing bug.Robin Watts
2011-12-15Memento tweak.Robin Watts
Slight memento tweak to simplify code (and correct problem with repeated event numbers when squeezing).
2011-12-15Another Memsqueezing bug.Robin Watts
2011-12-15Various Memsqueezing fixes.Robin Watts
Fixes for leaks (and SEGVs, division by zeros etc) seen when Memsqueezing.
2011-12-15Fix warnings/errors on unix builds.Robin Watts
Fix warnings/errors thrown up by the last few commits (which were only tested on windows).
2011-12-15Don't count ROM data in size of fontdescs.Robin Watts
The substitute fonts used in a fontdesc are held in ROM, and as such should not count towards the size of a fontdesc. Simple fix; remove the lines that adds that in.
2011-12-15Add scavenging functionality.Robin Watts
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.
2011-12-15Add MEMENTO_MAXMEMORY (and Memento_setMax).Robin Watts
New Memento feature that enables us to easily test scavenging.
2011-12-15Bring Memento up to date with changes in gs.Robin Watts
Memento_listBlocks and Memento_listNewBlocks.
2011-12-15Remove stray whitespace.Tor Andersson
2011-12-15Remove 'soft limit' on pixmaps in favour of fz_store.Robin Watts
Change the fz_store to be limited to 256 Megs. Remove the soft limit for pixmaps; the store will automatically throw old resources away to stay below the limit.
2011-12-15Rework pdf_store to fz_store, a part of fz_context.Robin Watts
Firstly, we rename pdf_store to fz_store, reflecting the fact that there are no pdf specific dependencies on it. Next, we rework it so that all the objects that can be stored in the store start with an fz_storable structure. This consists of a reference count, and a function used to free the object when the reference count reaches zero. All the keep/drop functions are then reimplemented by calling fz_keep_sharable/fz_drop_sharable. The 'drop' functions as supplied by the callers are thus now 'free' functions, only called if the reference count drops to 0. The store changes to keep all the items in the store in the linked list (which becomes a doubly linked one). We still make use of the hashtable to index into this list quickly, but we now have the objects in an LRU ordering within the list. Every object is put into the store, with a size record; this is an estimate of how much memory would be freed by freeing that object. The store is moved into the context and given a maximum size; when new things are inserted into the store, care is taken to ensure that we do not expand beyond this size. We evict any stored items (that are not in use) starting from the least recently used. Finding an object in the store now takes a reference to it already. LOCK and UNLOCK comments are used to indicate where locks need to be taken and released to ensure thread safety.
2011-12-12Add -i and -f flags to pdfclean.Robin Watts
Update pdfclean with some new decompression options; -d changes it's definition (though not it's behaviour) to mean "decompress all streams". New flags, -i and -f toggle the decompression of image and font streams respectively.
2011-12-09Reinstate some missing fz_vars.Robin Watts
2011-12-09Fix pdfdraw "repairing" every document.Robin Watts
When adding the exception handling in, I'd mis-indented some code. This caused all the file to be read.
2011-12-09Squash 2 warnings (fz_obj * != int).Robin Watts
2011-12-09Fix missing " in win_main.cRobin Watts
2011-12-08Stylistic changes when testing pointer values for NULL.Tor Andersson
Also: use 'cannot' instead of 'failed to' in error messages.
2011-12-08Remove deprecated error handling code.Tor Andersson
2011-12-08Throw exceptions in xps code.Tor Andersson
2011-12-08Remove remaining fz_error_note calls in the pdf code.Tor Andersson
2011-12-08Use context in x11_main.Tor Andersson
2011-12-08Throw exceptions for read errors.Tor Andersson