Skip to content

Inline functions in compat.c are not inlined #45

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

Closed
shinderuk opened this issue Apr 8, 2022 · 0 comments · Fixed by #57
Closed

Inline functions in compat.c are not inlined #45

shinderuk opened this issue Apr 8, 2022 · 0 comments · Fixed by #57

Comments

@shinderuk
Copy link
Contributor

They probably should be in a header.

On Linux:

$ objdump -d pg_wait_sampling.so | grep -i 'call.*compat'
    3e4c:	e8 8f f7 ff ff       	callq  35e0 <shm_mq_detach_compat@plt>
    47b4:	e8 97 ef ff ff       	callq  3750 <CreateTemplateTupleDescCompat@plt>
    4ca4:	e8 37 e9 ff ff       	callq  35e0 <shm_mq_detach_compat@plt>
    4f01:	e8 4a e8 ff ff       	callq  3750 <CreateTemplateTupleDescCompat@plt>
    5282:	e8 c9 e4 ff ff       	callq  3750 <CreateTemplateTupleDescCompat@plt>
    5b52:	e8 89 da ff ff       	callq  35e0 <shm_mq_detach_compat@plt>
    5c51:	e8 0a da ff ff       	callq  3660 <shm_mq_send_compat@plt>
    5caa:	e8 b1 d9 ff ff       	callq  3660 <shm_mq_send_compat@plt>
    5d17:	e8 44 d9 ff ff       	callq  3660 <shm_mq_send_compat@plt>
    5d48:	e8 13 d9 ff ff       	callq  3660 <shm_mq_send_compat@plt>

On macOS:

% otool -tV pg_wait_sampling.so | grep -i 'call.*compat'
0000000000001a72	callq	_CreateTemplateTupleDescCompat
0000000000001eab	callq	_CreateTemplateTupleDescCompat
000000000000231b	callq	_shm_mq_detach_compat
00000000000024fd	callq	_CreateTemplateTupleDescCompat
0000000000002778	callq	_shm_mq_detach_compat
0000000000002a5b	callq	_shm_mq_detach_compat
0000000000002f74	callq	_shm_mq_send_compat
00000000000030a9	callq	_shm_mq_send_compat
0000000000003123	callq	_shm_mq_send_compat
0000000000003188	callq	_shm_mq_send_compat
maksm90 pushed a commit to arenadata/pg_wait_sampling that referenced this issue Aug 17, 2022
Current implementation segregated compatible inline function wrappers
into separate .c file that prevented inlining of these functions into
caller points in other modules. In current patch all these fuctions are
moved to header file compat.h so that inlining works.

Resolve postgrespro#45
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 a pull request may close this issue.

1 participant