Open nils-van-zuijlen opened 8 months ago
Also, I could not find your fork of bytes
, and so cannot help with that.
I managed to get it working by modifying the code retrieved from crates.io, I would really like to contribute back my changes so that a wider audience can enjoy them.
Hey @nils-van-zuijlen, I am having the same issue you are - would like to use tiny-artnet without an allocator (on RP2040 (Pi Pico W)). Can you share what you changed to get it to work? Doesn't have to be a polished PR
In tiny-artnet
, Cargo.toml
:
[dependencies]
nom = { version = "7.1.1", default-features = false, features = [] }
tiny-artnet-bytes-no-atomic = { version = "1.2.2", path = "../tiny-artnet-bytes-no-atomic", default-features = false }
In tiny-artnet-bytes-no-atomic
:
To get this code, use cargo vendor
, it will be downloaded in the vendor
folder. You may follow the steps echoed by cargo and edit it there, or copy it to another folder.
Cargo.toml
alloc
[features]
default = ["std", "alloc"]
std = []
alloc = []
src/lib.rs
extern crate alloc
#[cfg(feature = "alloc")]
extern crate alloc;
src/buf/buf_impl.rs
use alloc
and impl<T: Buf + ?Sized> Buf for Box<T>
src/buf/buf_mut.rs
use alloc
, impl<T: Buf + ?Sized> Buf for Box<T>
and unsafe impl BufMut for Vec<u8>
src/buf/mod.rs
mod vec_deque;
mod uninit_slice;
#[cfg(feature = "alloc")]
mod vec_deque;
#[cfg(feature = "std")]
mod writer;
Awesome thank you for finding the change and for the nice writeup!!
Also huge thank you to @nils-van-zuijlen for the write up, this does indeed work!
For anyone also having trouble: I also found this fork by @maximeborges which replaces the tokio/bytes crate with another one called byte which just works out of the box. I couldn't test if it actually works because I'm missing the hardware, but it does compile so chances are this does indeed work 😃
I was a bit in a rush to get that working and completely forgot to open a PR. I'll have a look at the code at some point to make sure everything is sound. IIRC my fork worked properly for 48h continuously without a single issue, so you should be able to play with it.
Hey all, I've unfortunately (fortunately?) become full time employed as of late on a big project and have totally ran out of time to work on this and other open source libraries.
If your interested in continuing the project feel free to create a fork under a different name and post it as a new crate - I'm sure a non-allocator version of this would be helpful to other folks too!
And hey, thanks for picking up my modest little artnet implementation and making it something better.
When in a no_std context, it is really common to have no allocator, but this crate requires
tiny-artnet-bytes-no-atomic
which requires having an allocator.It would be nice if that was not the case, or at least documented.