Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
ca29351
fix: Open up API to swap out pointers
tmathern Jul 16, 2026
ab5c6f6
Merge branch 'main' into mathern/open-up-api
tmathern Jul 16, 2026
af97d7f
fix: Hardening native handles
tmathern Jul 16, 2026
3c04587
fix: COmments
tmathern Jul 17, 2026
9d7b2ac
fix: Update PID stamping
tmathern Jul 17, 2026
e926b5f
fix: Make isntances swappable
tmathern Jul 17, 2026
222b9a8
fix: Update tests
tmathern Jul 17, 2026
3f93e7e
fix: Improve pointers handling
tmathern Jul 17, 2026
97fe07e
fix: Improve pointers handling 2
tmathern Jul 17, 2026
d95a9d7
fix: The refactor
tmathern Jul 17, 2026
14ca4ec
Merge branch 'main' into mathern/open-up-api
tmathern Jul 17, 2026
0309a92
fix: Improve pointers handling 4
tmathern Jul 18, 2026
d6ebd6f
fix: Improve pointers handling 5
tmathern Jul 18, 2026
fad717b
fix: Rebaseline
tmathern Jul 18, 2026
075fb21
fix: Clean up debug
tmathern Jul 19, 2026
2a78a76
fix: Refactor
tmathern Jul 20, 2026
c24ede6
fix: Refactor
tmathern Jul 20, 2026
359ce98
fix: Refactor 3
tmathern Jul 20, 2026
85b6bfd
fix: Refactor once more
tmathern Jul 20, 2026
2725dce
fix: Baseline for new scenarios
tmathern Jul 20, 2026
7c946b9
fix: Rename vars for clarity
tmathern Jul 20, 2026
f342997
fix: Refactor once more 2
tmathern Jul 20, 2026
e8504bf
fix: Docs
tmathern Jul 20, 2026
f02e14b
fix: Handle handling handles (#296)
tmathern Jul 21, 2026
b0ea8ea
fix: Refactor to simplify based on current C FFI (#297)
tmathern Jul 22, 2026
bdc1a11
ci: Merge commit
tmathern Jul 22, 2026
1e72d83
ci: Merge commit for realz
tmathern Jul 22, 2026
d1f5abc
ci: Clarify comments
tmathern Jul 22, 2026
2ba7209
ci: Re-refactor
tmathern Jul 22, 2026
61d503c
fix: Refactor + docs update
tmathern Jul 22, 2026
e857a52
fix: Docs
tmathern Jul 22, 2026
1ee9a49
fix: Docs 2
tmathern Jul 22, 2026
e588a6a
fix: Docs 3
tmathern Jul 22, 2026
7ae2a20
fix: mermaid
tmathern Jul 22, 2026
2e03ded
fix: Update docs to clarify double-free and such
tmathern Jul 23, 2026
c1e99cb
ci: Merge remote-tracking branch 'refs/remotes/origin/mathern/open-up…
tmathern Jul 23, 2026
93b2283
Merge branch 'main' into mathern/open-up-api
tmathern Jul 24, 2026
e58e113
fix: Review comments
tmathern Jul 25, 2026
b998747
fix: Docs typo
tmathern Jul 25, 2026
99a9e51
fix: Merge commit
tmathern Jul 27, 2026
31c0a43
Update read.py
tmathern Jul 27, 2026
4c4bd1e
Change print statement from crjson to json
tmathern Jul 27, 2026
88d6e43
Update print statements to use reader.json()
tmathern Jul 27, 2026
e8f0c77
fix: Add tests to verify TSA URL use
tmathern Jul 28, 2026
f511414
fix: Initial resolver bindings
tmathern Jul 28, 2026
910d5f9
Merge branch 'main' into mathern/http-resolver-custom
tmathern Jul 28, 2026
6d3e0c7
fix: formatting
tmathern Jul 28, 2026
a8f56d7
fix: Examples
tmathern Jul 28, 2026
115baa3
ci: Merge remote-tracking branch 'refs/remotes/origin/mathern/http-re…
tmathern Jul 28, 2026
165db90
fix: Refactor
tmathern Jul 28, 2026
769817c
fix: Network stuff
tmathern Jul 28, 2026
0350696
fix: Refactor 1
tmathern Jul 28, 2026
92024e3
fix: Refactor 2
tmathern Jul 28, 2026
535690f
fix: Refactor 3
tmathern Jul 28, 2026
258c619
fix: Refactor 3
tmathern Jul 28, 2026
4dc23fd
fix: Renamings
tmathern Jul 28, 2026
20c0a95
fix: Refactor once more
tmathern Jul 28, 2026
f449d4f
fix: Refactor twice more
tmathern Jul 28, 2026
184790f
fix: Refactor thrice more
tmathern Jul 28, 2026
b5a2a5f
fix: docs
tmathern Jul 28, 2026
3eea944
fix: refact0r
tmathern Jul 28, 2026
c785450
fix: docs
tmathern Jul 28, 2026
377cd27
fix: hardening
tmathern Jul 29, 2026
ad7d51c
fix: Fix format
tmathern Jul 29, 2026
6d6e4e6
fix: Docs clean up
tmathern Jul 29, 2026
701d716
fix: Docs clean up 2
tmathern Jul 29, 2026
0cd2a25
fix: Docs clean up 3
tmathern Jul 29, 2026
95dd713
fix: Docs clean up once more
tmathern Jul 29, 2026
17adc38
fix: Docs clean up once more 2
tmathern Jul 29, 2026
89d879c
fix: Docs clean up once more 3
tmathern Jul 29, 2026
d140c17
fix: Docs pass
tmathern Jul 29, 2026
24b9343
fix: Docs pass 2
tmathern Jul 29, 2026
52c41d8
fix: Docs pass 3
tmathern Jul 29, 2026
b0a3c6e
fix: Clean up docs and examples
tmathern Jul 29, 2026
80da5fd
ci: Merge commit
tmathern Jul 29, 2026
f72879f
Update dependency description in http_resolver_example_impl.py
tmathern Jul 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/native-resources-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ The cleanup order matters: `_release()` runs first (closing streams, dropping ca

### Dropping a Context reference

`Reader` and `Builder` both keep a `_context` attribute that is written once and never read. It is not dead code: it is what keeps the Context alive while the native handle depends on it. Without that reference, `Reader("image/jpeg", stream, context=Context())` would let the Context become collectable as soon as the constructor returned, even though the reader is still using it.
`Reader` and `Builder` both keep a `_context` attribute that is written once and never read. The reference keeps the Context alive while the native handle depends on it. Without it, `Reader("image/jpeg", stream, context=Context())` would let the Context become collectable as soon as the constructor returned, even though the reader is still using it.

Clearing it in `_release()` is the other half of that. A closed Reader has no further use for the Context, and holding the reference would keep alive an object nothing can reach through the Reader's public API.

Expand Down Expand Up @@ -530,7 +530,7 @@ sequenceDiagram

Both `_cleanup_resources()` and the consumed teardown take this branch. Neither simply skips the work: they null the handle and mark the object `CLOSED` so the child cannot go on to use it or try to free it later. Mutating the child's copy has no effect on the parent's, which is untouched and still valid.

The memory the child skips is not lost for good. A child that calls `exec()` replaces its address space; a child that exits has its memory reclaimed by the OS. Even a long-lived child (a `multiprocessing` worker using the fork start method) retains at most the objects it inherited at fork time, which is a bounded, one-off amount rather than a growing leak. Anything the child allocates itself carries the child's own PID and is freed normally.
The memory the child skips is reclaimed anyway. A child that calls `exec()` replaces its address space; a child that exits has its memory reclaimed by the OS. Even a long-lived child (a `multiprocessing` worker using the fork start method) retains at most the objects it inherited at fork time, which is a bounded, one-off amount rather than a growing leak. Anything the child allocates itself carries the child's own PID and is freed normally.

> [!NOTE]
> `is_foreign_process()` returns `False` when no owner PID was ever recorded, so an object that somehow missed the stamp is cleaned up as before rather than leaking silently.
Expand Down
Loading
Loading