Zero initialize NumaTopology so it lands in .bss. - #948
Draft
copybara-service[bot] wants to merge 1 commit into
Draft
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
copybara-service
Bot
force-pushed
the
test_982642502
branch
from
September 16, 2026 19:45
ec8ba81 to
b3c8c36
Compare
copybara-service
Bot
force-pushed
the
test_982642502
branch
3 times, most recently
from
September 17, 2026 01:56
f4e8de7 to
f1853f2
Compare
bind_mode_ and num_nodes_ were the only non-zero member initializers in NumaTopology, so Static::numa_topology_ (16440 B) was emitted into google_malloc_data (PROGBITS) rather than google_malloc_bss (NOBITS). This shrinks google_malloc_data from 19252 B to 2812 B (-85%) in alloc_at_least_test built with -c opt --dynamic_mode=off. InitNumaTopology unconditionally writes *num_nodes, but only wrote *bind_mode when TCMALLOC_NUMA_AWARE selected a recognized mode, so the kAdvisory default came solely from the in-class initializer. Write it explicitly instead, preserving behavior. PiperOrigin-RevId: 982642502
copybara-service
Bot
force-pushed
the
test_982642502
branch
from
September 17, 2026 02:14
f1853f2 to
322a7b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Zero initialize NumaTopology so it lands in .bss.
bind_mode_ and num_nodes_ were the only non-zero member initializers in
NumaTopology, so Static::numa_topology_ (16440 B) was emitted into
google_malloc_data (PROGBITS) rather than google_malloc_bss (NOBITS).
This shrinks google_malloc_data from 19252 B to 2812 B (-85%) in
alloc_at_least_test built with -c opt --dynamic_mode=off.
InitNumaTopology unconditionally writes *num_nodes, but only wrote
*bind_mode when TCMALLOC_NUMA_AWARE selected a recognized mode, so the
kAdvisory default came solely from the in-class initializer. Write it
explicitly instead, preserving behavior.