Skip to content

Copy bytes in ctypes.cast - #2171

Merged
slozier merged 1 commit into
IronLanguages:mainfrom
slozier:byteswap
Nov 17, 2026
Merged

slozier merged 1 commit into
IronLanguages:mainfrom
slozier:byteswap

Conversation

@slozier

@slozier slozier commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Fixes intermittent test_byteswap failures, which became much more frequent after #2168. That PR caused cast(some_bytes, ...) to point at a temporary copy instead of the underlying bytes object's array. It now copies into native memory owned by the result. Unlike CPython, writes through the pointer don't change the bytes object. Matching CPython would require bytes to store a trailing NUL.

@slozier
slozier merged commit 9ef7709 into IronLanguages:main Nov 17, 2026
41 checks passed
@slozier
slozier deleted the byteswap branch November 17, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant