Skip to content

PGPRO-6601: Add prefix to global variables and functions. #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 2, 2022

Conversation

shinderuk
Copy link
Contributor

This is necessary to avoid name collision with other modules. Where possible,
make variables and functions static.

Before:

% nm -gU pg_wait_sampling.so                                            
00000000000014cc T _Pg_magic_func
00000000000014f8 T __PG_init
0000000000002bec T _alloc_history
00000000000014d8 T _check_shmem
0000000000008020 S _collector_hdr
0000000000002c24 T _collector_main
0000000000008010 S _collector_mq
000000000000210c T _init_lock_tag
0000000000001d04 T _pg_finfo_pg_wait_sampling_get_current
0000000000002764 T _pg_finfo_pg_wait_sampling_get_history
0000000000002124 T _pg_finfo_pg_wait_sampling_get_profile
000000000000269c T _pg_finfo_pg_wait_sampling_reset_profile
0000000000001d10 T _pg_wait_sampling_get_current
0000000000002770 T _pg_wait_sampling_get_history
0000000000002130 T _pg_wait_sampling_get_profile
00000000000026a8 T _pg_wait_sampling_reset_profile
0000000000008018 S _proc_queryids
0000000000008038 S _queueTag
0000000000008028 S _recv_mq
0000000000008030 S _recv_mqh
0000000000002b38 T _register_wait_collector
0000000000008000 S _shmem_initialized
0000000000008008 S _toc

After:

% nm -gU pg_wait_sampling.so                                                
0000000000001560 T _Pg_magic_func
000000000000156c T __PG_init
0000000000001d74 T _pg_finfo_pg_wait_sampling_get_current
00000000000027dc T _pg_finfo_pg_wait_sampling_get_history
0000000000002194 T _pg_finfo_pg_wait_sampling_get_profile
000000000000270c T _pg_finfo_pg_wait_sampling_reset_profile
0000000000001d80 T _pg_wait_sampling_get_current
00000000000027e8 T _pg_wait_sampling_get_history
00000000000021a0 T _pg_wait_sampling_get_profile
0000000000002718 T _pg_wait_sampling_reset_profile
0000000000008010 S _pgws_collector_hdr
0000000000002c64 T _pgws_collector_main
0000000000008000 S _pgws_collector_mq
000000000000217c T _pgws_init_lock_tag
0000000000008008 S _pgws_proc_queryids
0000000000002bb0 T _pgws_register_wait_collector

This is necessary to avoid name collision with other modules. Where possible,
make variables and functions static.
@shinderuk shinderuk requested a review from maksm90 September 1, 2022 12:33
@shinderuk shinderuk merged commit 2d6f012 into master Sep 2, 2022
@shinderuk shinderuk deleted the prefix-globals branch September 2, 2022 16:22
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