You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add test proving ArrayWrapper lifetime management works correctly
Added comprehensive test_value_output_lifetime_management that verifies:
- ArrayWrapper stays alive after function returns via memoryview base
- Data remains valid after garbage collection
- Reference counting works correctly to prevent premature destruction
- Weak references confirm proper lifetime management
Test uses gc.collect(), weakref, and sys.getrefcount() to prove that the memoryview base (created by buffer protocol) keeps a reference to the ArrayWrapper, preventing it from being garbage collected while the numpy array exists.
This provides hard evidence that lifetime management is correct for value returns using ArrayWrapper.
Addresses comment 3679464435
Co-authored-by: jpfeuffer <8102638+jpfeuffer@users.noreply.github.com>
0 commit comments