summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2016-09-16 15:23:32 +0100
committerChris Liddell <chris.liddell@artifex.com>2016-09-26 11:35:12 +0100
commitc3c48bbdda6915abfe39b4a0de9978555fc071ba (patch)
treee904c5d339759d483be06fd117fe32c6459e8db5
parent974843fc7c06bc7354bd5f74f87a22014b0a1e16 (diff)
downloadghostpdl-c3c48bbdda6915abfe39b4a0de9978555fc071ba.tar.gz
Clump has_refs - follow up to commit 63f74ce6
The function save_set_new() (where the original fix for 'has_refs' is located) is called in two circumstances: when creating a save level, and when destroying a save level. We have to retain the 'has_refs' value for the latter case for the garbager to function correctly, but doing so in the former results in the garbager sometimes scanning more memory than is really necessary (it can end up scanning ref memory from the previous save state, which is pointless since that cannot change). This change means that 'has_refs == true' will only be retained in the 'destroying a save level' case (which works correctly because, by the time the function is called, we've already returned the relevant allocated to its previous state).
-rw-r--r--psi/isave.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/psi/isave.c b/psi/isave.c
index 34c298c9c..a926780cd 100644
--- a/psi/isave.c
+++ b/psi/isave.c
@@ -1282,7 +1282,7 @@ save_set_new(gs_ref_memory_t * mem, bool to_new, bool set_limit, ulong *pscanned
/* These are refs, scan them. */
ref_packed *prp = (ref_packed *) (pre + 1);
uint size;
- has_refs = true;
+ has_refs = true && to_new;
code = mark_allocated(prp, to_new, &size);
if (code < 0)
return code;