Skip to content

Do not embed reflect.Value into exportedMethod - #436

Merged
guelfey merged 1 commit into
godbus:masterfrom
kolyshkin:no-embed-reflect-value
Sep 24, 2026
Merged

guelfey merged 1 commit into
godbus:masterfrom
kolyshkin:no-embed-reflect-value

Conversation

@kolyshkin

@kolyshkin kolyshkin commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Embedding reflect.Value promotes all of its methods to exportedMethod, which the linker then has to keep since the type is used via an interface. None of them are needed; use a named field instead.

A minor cleanup; makes the test binary about 74K smaller.

@kolyshkin
kolyshkin force-pushed the no-embed-reflect-value branch from 20cf11a to 796b365 Compare September 22, 2026 19:42
@kolyshkin

Copy link
Copy Markdown
Contributor Author

(an initial version of this PR claimed this is needed to re-enable DCE -- this was wrong).

Embedding reflect.Value promotes all of its methods to exportedMethod,
and since it is used via an interface, the linker has to keep them.
None of these are needed; use a named field instead.

This makes the test binary about 74K smaller.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@guelfey
guelfey force-pushed the no-embed-reflect-value branch from 796b365 to 3b9769b Compare September 24, 2026 12:44
@guelfey
guelfey merged commit 6fea989 into godbus:master Sep 24, 2026
7 checks passed
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