Age | Commit message (Collapse) | Author |
|
Add some helpful functions for doing quick checks on pointer validity.
Use these in the reference counting functions.
|
|
|
|
|
|
|
|
Including: Bug 697134: Tweak MEMENTO_GS_HACKS inclusion.
Rather than rolling our own memset prototype in this case, use
the one that gs provides.
And, bug 697133: Fix typo in Memento.
Causing a significant slowdown. Thanks to George Burgess IV
for spotting this.
|
|
|
|
|
|
Add backtrace abilities, and fix missing return value from
android logging.
|
|
memory.h isn't part of the C standard, and Xcode was getting upset
when building mupdf as a module:
error: include of non-modular header inside framework module
'MuPDF.mupdf.memento'
[-Werror,-Wnon-modular-include-in-framework-module]
|
|
Harfbuzz allocates blocks that it keeps around as statics.
There are a finite number of these, and they are never freed
(at least not in the build we use). Having Memento report
them as leaks is a pain.
So we extend Memento so that we can label blocks as being
leaks, and thus never have to be bothered by them.
|
|
These work with MEMENTO_DETAILS to allow us to store the events where
reference counts change.
|
|
|
|
Avoid searching the linked list of blocks in order to remove a
block by moving to a doubly linked list. This can be done
without increasing the amount of memory in use by making better
use of the 'parent' pointer that is only used when displaying
nested blocks.
Also store magic values in the 'child' and 'sibling' pointers
(again only used when displaying nested blocks) so that we
can quickly verify that a block is real before doing too much
with it.
Those changes drastically reduce the time required for
MEMENTO_LEAKONLY runs (now the same order of magnitude as non
memento runs).
Normal memento runs are still very slow when the numbers of
blocks increase due to the paranoid checking taking time.
To ameliorate this a bit, we try 2 other things.
Firstly, we optimise the searching of blocks by making use of
int aligned tests. This still doesn't make much difference.
Secondly, we introduce a new mechanism for the 'paranoia'
levels. If a negative number is given for the paranoia level
(say -n) then we first perform our overwrite checks after n events.
We next test after 2n events, then 4n, then 8n etc.
The new default paranoia level is set to be -1024.
This makes a huge difference, and brings normal memento runs
down to be comparable with debug runs.
|
|
Firstly, when displaying a list of nested blocks, don't suppress
outputting a block just because it contains a pointer to itself.
Various valgrind fixes from the gs version of memento.
Experimental C++ operators. See writeup in memento.h comments for
how to integrate.
|
|
|
|
|