Cycle list refactor#158
Merged
Merged
Conversation
Add shared reader traits in pdf-page so dictionary-backed and stream-backed objects own their cycle handling in one place. The default cyclic_read path now returns a cyclic dependency error, while PdfPages keeps its branch-skipping behavior. Update the page reader, XObject reader, ExtGState reader, and call sites to use the trait entrypoints directly. Document the new object_reader module and keep the public reader APIs consistent across the workspace. Co-authored-by: Codex <codex@openai.com>
Replace the shared cycle-list wrapper with direct HashSet tracking in pdf-page's default resource cache and in pdf-object-collection's reference resolver. The page reader traits already own begin/end cycle handling, so the extra helper struct was redundant and removed along with its public module export. Co-authored-by: Codex <codex@openai.com>
Move active read tracking out of ResourceCache and into pdf-page's object readers so the cycle guard lives beside the ReadFromDictionary and ReadXObject entrypoints. Thread a dedicated ReadCycleTracker through page, resource, and XObject parsing, while keeping lazy cache placeholder resolution separate from active-read cycle detection. Update the document page-tree entrypoint and the related tests to construct and pass the tracker explicitly. Co-authored-by: Codex <codex@openai.com>
Return cyclic dictionary and XObject reads as None instead of threading cyclic-dependency errors through call sites. This keeps the page-tree, resource, pattern, and soft-mask code paths explicit about optional recursive results while removing the old predicate helpers. Also drop the redundant cyclic-dependency helpers from the page and image error types. Co-authored-by: Codex <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.