AkiyukiOkayasu / pacmog

PCM decoding library for embedded systems
Apache License 2.0
6 stars 3 forks source link

Make pacmog no-alloc #49

Closed kevinclark closed 3 weeks ago

kevinclark commented 1 month ago

As great as anyhow is, it requires a global allocator. Since pacmog is targeted towards embedded systems, requiring alloc limits its adoption. Doing that for an error framework seems like an awkward tradeoff. This PR replaces anyhow with embeded_error_chain which is no-std and no-alloc.

Totally understand this is an unsolicited and somewhat large change. I need it for my use, so I'll maintain it on my own if I need to. Seemed like a reasonable speculative change though given pacmog's positioning.

AkiyukiOkayasu commented 4 weeks ago

anyhow is not suitable for pacmog, I agree with that. I think error_in_core will be stable in Rust v1.81, so I'll leave error handling alone for now. It may be replaced when thiserror becomes available in no_std.

AkiyukiOkayasu commented 3 weeks ago

Resolved in https://github.com/AkiyukiOkayasu/pacmog/pull/52 . it should be noted that Rust 1.81 or later is required. Not yet published on crate.io (there is still some work to do).