Skip to content

Conversation

@metux
Copy link
Contributor

@metux metux commented Sep 23, 2025

The private struct is pretty small and it needs to be allocated anyways,
so save an extra allocation by directly embedding it.

Signed-off-by: Enrico Weigelt, metux IT consult [email protected]

The private struct is pretty small and it needs to be allocated anyways,
so save an extra allocation by directly embedding it.

Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
metux added a commit that referenced this pull request Sep 24, 2025
metux added a commit that referenced this pull request Sep 25, 2025
metux added a commit that referenced this pull request Sep 26, 2025
metux added a commit that referenced this pull request Sep 26, 2025
metux added a commit that referenced this pull request Sep 26, 2025


typedef struct _ShmScrPrivateRec {
Bool initialized;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this flag at all? It looks like it’s set, but not really used. Or it’s intended for external usage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's supposed to protect from duplicate initialization.
the original code was looking at the pointer value, so I kept this flag for safety.
not sure whether it's really needed.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe print some warning (or a fatal error?) if a repeated init or deinit is attempted? To add some meaning to that flag 🙂

metux added a commit that referenced this pull request Sep 29, 2025
metux added a commit that referenced this pull request Oct 1, 2025
metux added a commit that referenced this pull request Oct 2, 2025
@github-actions
Copy link

Merge Conflict found

Copy link
Contributor

@stefan11111 stefan11111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than what @algrid said, lgtm

@github-actions
Copy link

Merge Conflict found

6 similar comments
@github-actions
Copy link

Merge Conflict found

@github-actions
Copy link

Merge Conflict found

@github-actions
Copy link

Merge Conflict found

@github-actions
Copy link

Merge Conflict found

@github-actions
Copy link

Merge Conflict found

@github-actions
Copy link

Merge Conflict found

@github-actions
Copy link

Merge Conflict found

@metux
Copy link
Contributor Author

metux commented Oct 21, 2025

This has become obsoleted by #1236

@metux metux closed this Oct 21, 2025
@metux metux deleted the pr/shm-use-embedded-private-instead-of-pointer-_2025-09-23_17-01-11 branch October 21, 2025 08:47
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.

4 participants