Skip to content

[#1745] refine flatbuffer api#1827

Merged
elfenpiff merged 26 commits into
eclipse-iceoryx:mainfrom
ekxide:iox2-1745-refine-flatbuffer-api
Jul 22, 2026
Merged

[#1745] refine flatbuffer api#1827
elfenpiff merged 26 commits into
eclipse-iceoryx:mainfrom
ekxide:iox2-1745-refine-flatbuffer-api

Conversation

@elfenpiff

@elfenpiff elfenpiff commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Notes for Reviewer

This is an intermediate PR. Some flatbuffer related functionality is not yet tested.

  • For flatbuffers the user needs to call loan_flatbuffer() instead of loan_uninit() (not yet functional)
  • The allocator traits are more generic and allow to specify a custom pointer type (preparing to use ShmPointer for shm allocators, required for flatbuffer allocator)
  • PointerTrait renamed to Pointer
  • GenericPointer renamed to PointerFamily, all Generic**Ptr renamed to **PtrFamily
  • Allocator returns Pointer<u8> instead of Pointer<[u8]> when acquiring memory

Pre-Review Checklist for the PR Author

  • Add sensible notes for the reviewer
  • PR title is short, expressive and meaningful
  • Consider switching the PR to a draft (Convert to draft)
    • as draft PR, the CI will be skipped for pushes
  • Relevant issues are linked in the References section
  • Branch follows the naming format (iox2-123-introduce-posix-ipc-example)
  • Commits messages are according to this guideline
    • Commit messages have the issue ID ([#123] Add posix ipc example)
    • Keep in mind to use the same email that was used to sign the Eclipse Contributor Agreement
  • Tests follow the best practice for testing
  • Changelog updated in the unreleased section including API breaking changes

PR Reviewer Reminders

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

References

Relates to #1745

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.08434% with 120 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.12%. Comparing base (b22dcbc) to head (53e2237).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
iceoryx2-bb/flatbuffers/src/resizable_memory.rs 0.00% 36 Missing ⚠️
iceoryx2/src/port/publisher.rs 11.53% 23 Missing ⚠️
iceoryx2/src/sample_mut_uninit.rs 65.21% 16 Missing ⚠️
iceoryx2-bb/elementary/src/sync_pointer.rs 33.33% 12 Missing ⚠️
iceoryx2-bb/elementary/src/relocatable_pointer.rs 25.00% 9 Missing ⚠️
iceoryx2-bb/elementary/src/owning_pointer.rs 42.85% 8 Missing ⚠️
iceoryx2-cal/src/shared_memory/mod.rs 0.00% 7 Missing ⚠️
iceoryx2-bb/elementary-traits/src/pointer.rs 50.00% 3 Missing ⚠️
iceoryx2-bb/posix/src/memory.rs 85.71% 3 Missing ⚠️
iceoryx2-bb/elementary/src/bump_allocator.rs 92.30% 1 Missing ⚠️
... and 2 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1827      +/-   ##
==========================================
- Coverage   76.28%   76.12%   -0.16%     
==========================================
  Files         441      443       +2     
  Lines       44030    44263     +233     
  Branches     1356     1356              
==========================================
+ Hits        33587    33695     +108     
- Misses       9324     9449     +125     
  Partials     1119     1119              
Flag Coverage Δ
CPP 62.96% <ø> (ø)
Rust 76.01% <71.08%> (-0.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
iceoryx2-bb/container/src/byte_atomic.rs 95.74% <100.00%> (ø)
iceoryx2-bb/container/src/flatmap.rs 79.80% <100.00%> (+0.09%) ⬆️
iceoryx2-bb/container/src/queue.rs 90.83% <100.00%> (ø)
iceoryx2-bb/container/src/slotmap.rs 90.58% <100.00%> (+0.04%) ⬆️
...ryx2-bb/container/src/string/polymorphic_string.rs 68.75% <100.00%> (ø)
...ryx2-bb/container/src/string/relocatable_string.rs 70.87% <100.00%> (+0.57%) ⬆️
iceoryx2-bb/container/src/vec.rs 73.38% <100.00%> (+0.43%) ⬆️
...ceoryx2-bb/container/src/vector/polymorphic_vec.rs 84.31% <100.00%> (ø)
...ceoryx2-bb/container/src/vector/relocatable_vec.rs 82.82% <100.00%> (+0.35%) ⬆️
iceoryx2-bb/elementary-traits/src/allocator.rs 78.04% <100.00%> (+10.19%) ⬆️
... and 46 more

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@elfenpiff
elfenpiff force-pushed the iox2-1745-refine-flatbuffer-api branch 3 times, most recently from b69ff60 to 2b402e6 Compare July 20, 2026 08:13
> Builder<Payload, UserHeader, ServiceType>
{
fn has_flatbuffer_payload() -> bool {
use iceoryx2_bb_elementary_traits::type_name::TypeName;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can the as ... two lines below be removed now?

Comment thread iceoryx2/src/service/builder/publish_subscribe.rs
Comment thread MODULE.bazel.lock Outdated
Comment thread iceoryx2-bb/elementary-traits/src/allocator.rs Outdated
Comment thread iceoryx2-bb/flatbuffers/src/lib.rs
Comment on lines +185 to +187
!(position < (self.start.as_ptr() as usize)
|| position > (self.start.as_ptr() as usize) + self.size
|| !(position - self.start.as_ptr() as usize).is_multiple_of(self.bucket_size)),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be clearer if you define self.start.as_ptr() as usize outside the debug_assert.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I know but the stuff inside the debug assert is optimized away when the debug assertions are disabled.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

True, but you do the same with position... Up to you.

Comment thread iceoryx2-bb/memory/src/pool_allocator.rs Outdated
Comment thread iceoryx2-cal/src/shared_memory/mod.rs
Comment thread iceoryx2/src/port/publisher.rs Outdated
Comment thread iceoryx2/src/port/publisher.rs Outdated
Comment thread iceoryx2-bb/memory/tests-common/src/one_chunk_allocator_tests.rs
Comment thread iceoryx2-bb/memory/tests-common/src/pool_allocator_tests.rs

@FerdinandSpitzschnueffler FerdinandSpitzschnueffler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only some nitpicks that can be addressed in the follow-up PR.

Comment on lines +222 to 223
/// * the pointer must be acquired with [`SharedMemory::allocate()`] - extracted from the
/// [`ShmPointer`]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// * the pointer must be acquired with [`SharedMemory::allocate()`] - extracted from the
/// [`ShmPointer`]
/// * the pointer must be acquired with [`SharedMemory::allocate()`]

@elfenpiff
elfenpiff merged commit 38db340 into eclipse-iceoryx:main Jul 22, 2026
105 of 106 checks passed
@elfenpiff
elfenpiff deleted the iox2-1745-refine-flatbuffer-api branch July 22, 2026 08:37
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.

3 participants