Skip to content

Conversation

@ldorau
Copy link
Contributor

@ldorau ldorau commented Feb 28, 2025

Description

Add annotations to umf_ba_alloc() and umf_ba_free().

Checklist

  • Code compiles without errors locally
  • All tests pass locally
  • CI workflows execute properly

@ldorau ldorau requested a review from a team as a code owner February 28, 2025 12:24

utils_mutex_unlock(&pool->metadata.free_lock);

utils_annotate_acquire(chunk);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why it is needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

@ldorau and I noticed similar code in tbb_malloc()/free() (however, in that case, the acquire/release is performed on the entire pool pointer, which could be invalid - ??). Generally, as I understand these calls, when an allocation is ready to be reused in another thread, all writes to it should be completed before returning it as a new allocation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't mutex above all ready introducing full memory barrier?

Copy link
Contributor

Choose a reason for hiding this comment

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

@lplewa +1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, it will not be needed.

@ldorau ldorau closed this Feb 28, 2025
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