Skip to content

add verify tag function#157

Merged
struct merged 2 commits intomasterfrom
memtag_verify
Nov 26, 2022
Merged

add verify tag function#157
struct merged 2 commits intomasterfrom
memtag_verify

Conversation

@struct
Copy link
Copy Markdown
Owner

@struct struct commented Nov 26, 2022

Introduce the iso_alloc_verify_ptr_tag function so systems with TBI can verify the pointer tag without removing it.

}

EXTERNAL_API void iso_alloc_verify_ptr_tag(void *p, iso_alloc_zone_handle *zone) {
if(zone == NULL) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is UNLIKELY I think.

return _untag_ptr(p, zone);
}

EXTERNAL_API void iso_alloc_verify_ptr_tag(void *p, iso_alloc_zone_handle *zone) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be a return if MEMORY_TAGGING isn't set?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I keep all the implementation details, include compile time excludes and likely/unlikely macros, to the internal code to keep the interfaces file from getting too complex. It makes it easier for me to reason about the API contracts.

@struct struct merged commit cc2787e into master Nov 26, 2022
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.

2 participants