Skip to content

zb: Don't use ArrayVec for message fields

Zeeshan Ali Khan requested to merge drop-vecarray into master

Even assuming only 8 fields, we end up with MessageFields struct taking always 1k bytes on the stack and that's not so ideal, especially if we pass this struct by value.

After further discussion with Rust embedded folks, noalloc isn't really something we should worry much about. The target platforms that needs noalloc aren't going to be typically users of D-Bus on. If we succeed in making zbus nostd, that would already be pretty neat. Also hopefully nostd+global_allocator is going to be stabalized at some point.

Having said that, we might be able to provide optional noalloc support in zvariant but certainly not something in the near future to think about.

This patch reverts:

zb: Get MessageFields mem usage below 1k: 73b328f1.
zb: MessageFields now stack-allocated: 0d456d61.

Edited by Zeeshan Ali Khan

Merge request reports