Age | Commit message (Collapse) | Author |
|
Following up on a report from a potential customer, fix various places
in mupdf.c where we were leaking memory (devices not freed, context
not properly freed etc).
In order to track this down, I added a Memento build - just do:
ndk-build MEMENTO=1
when building. This only checks for leaks, not for memory overwrites
by default as it uses MEMENTO_LEAKONLY to avoid any possibility of the
android kernel killing stuff for being too slow or using too much
memory.
|
|
|
|
Leaking long linked lists leads to stack overflows during the
Memento debug output. Avoid this by iterating rather than recursing
where possible.
Also, for sanities sake, where we intent more than 40 spaces, use a
single '*' instead. This keeps logfiles sane.
|
|
This brings in Memento_breakOnRealloc and Memento_breakOnFree along with
some other small tweaks.
|
|
|
|
|
|
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.
|
|
Disabled for now by default.
Better SEGV handling under windows (to facilitate scripted squeezing)
|
|
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.
|
|
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.
|
|
Slight memento tweak to simplify code (and correct problem with
repeated event numbers when squeezing).
|
|
Fixes for leaks (and SEGVs, division by zeros etc) seen when
Memsqueezing.
|
|
New Memento feature that enables us to easily test scavenging.
|
|
Memento_listBlocks and Memento_listNewBlocks.
|
|
Also: use 'cannot' instead of 'failed to' in error messages.
|
|
This frees us from passing errors back everywhere, and hence enables us
to pass results back as return values.
Rather than having to explicitly check for errors everywhere and bubble
them, we now allow exception handling to do the work for us; the
downside to this is that we no longer emit as much debugging information
as we did before (though this could be put back in). For now, the
debugging information we have lost has been retained in comments
with 'RJW:' at the start.
This code needs fuller testing, but is being committed as a work in
progress.
|
|
Huge pervasive change to lots of files, adding a context for exception
handling and allocation.
In time we'll move more statics into there.
Also fix some for(i = 0; i < function(...); i++) calls.
|
|
Import memento files. Update Makefile to support: make build=memento
(like debug, but with memento too).
Tiny tweak to cmapdump to avoid memento building that utility.
|