Skip to content

Promote 16-bit allocated counts to unsigned before absl::bit_width in CentralFreeList. - #722

Draft
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_979995927
Draft

Promote 16-bit allocated counts to unsigned before absl::bit_width in CentralFreeList.#722
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_979995927

Conversation

@copybara-service

Copy link
Copy Markdown

Promote 16-bit allocated counts to unsigned before absl::bit_width in CentralFreeList.

Calling absl::bit_width on uint16_t dispatches to CountLeadingZeroes16, which executes extra shifts and masking compared to native 32-bit lzcnt/clz instructions. Promoting prev_allocated and cur_allocated to unsigned in ReleaseToSpans and RemoveRange elides this 16-bit bit-manipulation overhead under the CentralFreeList spinlock.

… CentralFreeList.

Calling absl::bit_width on uint16_t dispatches to CountLeadingZeroes16, which executes extra shifts and masking compared to native 32-bit lzcnt/clz instructions. Promoting prev_allocated and cur_allocated to unsigned in ReleaseToSpans and RemoveRange elides this 16-bit bit-manipulation overhead under the CentralFreeList spinlock.

PiperOrigin-RevId: 979995927
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