summaryrefslogtreecommitdiff
path: root/platform/ios/build_libs.sh
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-04-25 15:09:00 +0100
committerRobin Watts <robin.watts@artifex.com>2016-04-26 10:54:49 +0100
commit1b16995f277aefda88957e31c00d963fc9a59d7a (patch)
tree0f331f9bafcac86f189fca781a3b48f45a0924a7 /platform/ios/build_libs.sh
parentf4a365df3f7709192ec6052832e857d2832ae47f (diff)
downloadmupdf-1b16995f277aefda88957e31c00d963fc9a59d7a.tar.xz
Fix fz_store thinko.
Previously, we would refuse to store any object in the store that was larger than the store limits. We'd also refuse to store any object that took the total store size over the limit. This was wrong. Consider the case where we have a store of 1 byte, and a page that repeatedly uses the same font. The first time we meet the font, we look in the store, it isn't there, we load it, and we try to store it. The current code refuses to store it, and we continue, putting that font into the display list. The next time we meet to the font, we look in the store, it still isn't there, we load it, and we try to store it. Again we refuse to store it, and that copy of the font goes into the display list. The net effect of this is that we end up using far more memory in total than we would have done had we stored the first one. The code here, therefore, changes the store to always store objects regardless of their size. Given that we have already loaded the objects into memory before we store them, this doesn't actually cost us any extra memory. If an object is dropped (bringing the reference count down to 1, being the reference for the stores copy), then the object is NOT freed instantly, but will be freed either on the next attempt to store an object, or on the next scavenging malloc.
Diffstat (limited to 'platform/ios/build_libs.sh')
0 files changed, 0 insertions, 0 deletions