Skip to content

Conversation

zeenix
Copy link
Owner

@zeenix zeenix commented Jun 15, 2025

This is an abstraction over heapless::pool::boxed and alloc::boxed.

@zeenix zeenix marked this pull request as draft June 15, 2025 15:13
@zeenix zeenix force-pushed the box branch 2 times, most recently from 41fb9d6 to cc425ba Compare June 15, 2025 15:28
@zeenix
Copy link
Owner Author

zeenix commented Jun 15, 2025

Keeping this in draft until heapless 0.9 is released (hopefully with my needed fixes) and we can then switch to using that. I'll also tackle the MSRV issue (probably just need bumping again).

zeenix added 3 commits August 20, 2025 18:41
This enables dependency on the `portable-atomic` crate and enables the
`portable-atomic` feature of `heapless`.
@zeenix zeenix marked this pull request as ready for review August 20, 2025 16:42
@zeenix
Copy link
Owner Author

zeenix commented Aug 21, 2025

@mkj If you adding the 👀 reaction to the PR means that you might be interested in this feature, I could use a second pair of eyes on this so if you could review it, that would be very helpful. 🙏

Copy link

@mkj mkj left a comment

Choose a reason for hiding this comment

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

Thanks for the ping - not sure if I'll be using boxed, though other bits of mayheap look useful for me in a couple of crates.

This PR looks good. A couple of minor thoughts.

@zeenix
Copy link
Owner Author

zeenix commented Aug 22, 2025

This PR looks good. A couple of minor thoughts.

That was an extremely helpful review. Thanks so much! If you could just have one last look before I merge, that would be great.

@mkj
Copy link

mkj commented Aug 23, 2025

Looks good. I think the const {} is still needed. It fails without it for me (the github action heapless test should have portable-atomic feature)

cargo --locked test --no-default-features --features heapless,serde,portable-atomic
..
error[E0277]: the trait bound `BoxBlock<u32>: std::marker::Copy` is not satisfied
 --> src/boxed.rs:16:1
  |
8 | box_pool!(MyBoxPool: u32, 2);
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `BoxBlock<u32>`

zeenix added 2 commits August 23, 2025 13:44
This is an abstraction over `heapless::pool::boxed` and `alloc::boxed`.
@zeenix
Copy link
Owner Author

zeenix commented Aug 23, 2025

Looks good. I think the const {} is still needed. It fails without it for me

Oh right, good catch! I had forgotten that portable-atomic is required for this module so was not really testing it at all. 🤦

(the github action heapless test should have portable-atomic feature)

Great idea. Done!

@zeenix zeenix merged commit 4e902e3 into main Aug 23, 2025
5 checks passed
@zeenix zeenix deleted the box branch August 23, 2025 12:09
@zeenix
Copy link
Owner Author

zeenix commented Aug 23, 2025

@mkj Many thanks for your help! 🙏👍

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.

2 participants