Skip to content
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

Replace session pointer with refcount #322

Merged
merged 36 commits into from
Jan 18, 2024

Conversation

jean-roland
Copy link
Contributor

Reopening of #320.

The entities session publisher, subscriber and queryables were sharing ownership of the same _z_session_t pointer, this caused issues like #312. This PR replaces the session pointer with a refcounter on the session pointer.

Had to modify how the refcount implementation was handled:

  • Restricted the thread unsafe one to single thread mode only
  • Added a c99 gcc only implementation

And renamed pointer.h / _sptr_t to refcount.h / _rc_t

* fix: build tests only in c11

* fix: remove c11 macros from examples

* feat: add a way to force c99 standard

* ci: add a c99 compilation test
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

Cppcheck (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link
Contributor

@p-avital p-avital left a comment

Choose a reason for hiding this comment

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

I'd really like that change to the structure of refcounts, but the rest is approved

include/zenoh-pico/collections/refcount.h Outdated Show resolved Hide resolved
@p-avital p-avital merged commit b48d2c1 into eclipse-zenoh:main Jan 18, 2024
48 checks passed
@jean-roland jean-roland mentioned this pull request Jan 19, 2024
@jean-roland jean-roland deleted the ft_more_refcount branch February 16, 2024 08:29
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.

None yet

2 participants