Skip to content

Conversation

@orxfun
Copy link
Owner

@orxfun orxfun commented Oct 13, 2025

index_of_ptr method is refactored.

The refactoring includes simplification of the implementation using the std methods such as slice.as_ptr_range() and ptr.offset_from. This makes the use of unsafe block more clear and better documented.

Fixes #52 .

Corresponding tests are introduced.

@orxfun orxfun merged commit 4a4007a into main Oct 16, 2025
1 check passed
@orxfun orxfun deleted the fix-52/index-of-ptr-safety branch October 16, 2025 13:39
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.

Potential Undefined Behavior in Unsound Function index_of_ptr

2 participants