Skip to content

Add extra memory manipulation functions #5792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

ernestognw
Copy link
Member

Depends on #5189

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

@ernestognw ernestognw requested a review from a team as a code owner July 9, 2025 18:28
Copy link

changeset-bot bot commented Jul 9, 2025

🦋 Changeset detected

Latest commit: 7158817

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
openzeppelin-solidity Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines +89 to +96
/// @dev Returns a `Pointer` to the `value`'s header (i.e. includes the length word).
function asPointer(bytes memory value) internal pure returns (Pointer) {
bytes32 ptr;
assembly ("memory-safe") {
ptr := value
}
return asPointer(ptr);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// @dev Returns a `Pointer` to the `value`'s header (i.e. includes the length word).
function asPointer(bytes memory value) internal pure returns (Pointer) {
bytes32 ptr;
assembly ("memory-safe") {
ptr := value
}
return asPointer(ptr);
}
/// @dev Returns a `Pointer` to the `value`'s header (i.e. includes the length word).
function asPointer(bytes memory value) internal pure returns (Pointer ptr) {
assembly ("memory-safe") {
ptr := value
}
}

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.

4 participants