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

[#224] implement placement new for containers #230

Conversation

elfenpiff
Copy link
Contributor

@elfenpiff elfenpiff commented Jun 5, 2024

Notes for Reviewer

Pre-Review Checklist for the PR Author

  1. Add sensible notes for the reviewer
  2. PR title is short, expressive and meaningful
  3. Relevant issues are linked in the References section
  4. Every source code file has a copyright header with SPDX-License-Identifier: Apache-2.0 OR MIT
  5. Branch follows the naming format (iox2-123-introduce-posix-ipc-example)
  6. Commits messages are according to this guideline
  7. Tests follow the best practice for testing
  8. Changelog updated in the unreleased section including API breaking changes
  9. Assign PR to reviewer
  10. All checks have passed (except task-list-completed)

Checklist for the PR Reviewer

  • 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

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

Closes #224

@elfenpiff elfenpiff requested a review from elBoberido June 5, 2024 15:38
@elfenpiff elfenpiff self-assigned this Jun 5, 2024
@elfenpiff elfenpiff force-pushed the iox2-224-implement-placement-new-for-containers branch from e18a35d to 4bf22d2 Compare June 5, 2024 16:54
Copy link

codecov bot commented Jun 5, 2024

Codecov Report

Attention: Patch coverage is 38.88889% with 99 lines in your changes missing coverage. Please review.

Project coverage is 79.67%. Comparing base (2626216) to head (1a97e46).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #230      +/-   ##
==========================================
- Coverage   80.02%   79.67%   -0.36%     
==========================================
  Files         183      186       +3     
  Lines       20426    20575     +149     
==========================================
+ Hits        16346    16393      +47     
- Misses       4080     4182     +102     
Files Coverage Δ
iceoryx2-bb/container/src/byte_string.rs 99.10% <100.00%> (+<0.01%) ⬆️
iceoryx2-bb/container/src/queue.rs 97.70% <100.00%> (+0.07%) ⬆️
iceoryx2-bb/container/src/vec.rs 91.34% <100.00%> (+0.30%) ⬆️
iceoryx2-pal/concurrency-sync/src/iox_atomic.rs 96.19% <ø> (ø)
iceoryx2-bb/testing/src/memory.rs 75.00% <75.00%> (ø)
iceoryx2-bb/elementary/src/placement_default.rs 15.68% <15.68%> (ø)
iceoryx2-bb/derive-macros/src/lib.rs 0.00% <0.00%> (ø)

... and 5 files with indirect coverage changes

@elfenpiff elfenpiff force-pushed the iox2-224-implement-placement-new-for-containers branch from 2b4b08c to f7441c0 Compare June 5, 2024 17:24
elBoberido
elBoberido previously approved these changes Jun 6, 2024
Copy link
Member

@elBoberido elBoberido left a comment

Choose a reason for hiding this comment

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

Looks good. Just a few nitpicks

examples/rust/complex_data_types/complex_data_types.rs Outdated Show resolved Hide resolved
iceoryx2-bb/container/tests/queue_tests.rs Outdated Show resolved Hide resolved
iceoryx2-bb/elementary/src/placement_default.rs Outdated Show resolved Hide resolved
iceoryx2-bb/derive-macros/tests/placement_default_tests.rs Outdated Show resolved Hide resolved
@elfenpiff elfenpiff force-pushed the iox2-224-implement-placement-new-for-containers branch from 4233ef5 to f964870 Compare June 6, 2024 17:09
@elfenpiff elfenpiff requested a review from elBoberido June 7, 2024 06:44
@elfenpiff elfenpiff force-pushed the iox2-224-implement-placement-new-for-containers branch 2 times, most recently from c542e3e to 1a97e46 Compare June 7, 2024 07:28
fn placement_default_works() {
let mut sut = RawMemory::<Sut>::new_filled(0xff);
unsafe { Sut::placement_default(sut.as_mut_ptr()) };
assert_that!(unsafe {sut.assume_init()}, len 0);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
assert_that!(unsafe {sut.assume_init()}, len 0);
let sut = unsafe { sut.assume_init() };
assert_that!(sut, len 0);

To not have to call assume_init consecutively

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, I would keep it as it is ... so that my future self has something to dislike me for ;)

@elfenpiff elfenpiff merged commit dcfaf01 into eclipse-iceoryx:main Jun 7, 2024
45 of 49 checks passed
@elfenpiff elfenpiff deleted the iox2-224-implement-placement-new-for-containers branch June 7, 2024 09:17
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.

Implement placement new concept
2 participants