cloud-hypervisor / rust-hypervisor-firmware

Apache License 2.0
608 stars 57 forks source link

build: Remove heap allocator #334

Closed retrage closed 6 months ago

retrage commented 6 months ago

PR #92 introduced heap allocator to implement EFI variable feature. However, none of other components uses heap. This commit removes the heap allocator and use the heapless crate instead of Vec. This change simplifies the build arguments.

rbradford commented 6 months ago

@retrage I'm happy to remove this - but do you think the support for protocol installation might require dynamic memory allocation?

retrage commented 6 months ago

@retrage I'm happy to remove this - but do you think the support for protocol installation might require dynamic memory allocation?

@rbradford My prototype of the protocol manager uses the fixed-sized hash map heapless::FnvIndexMap to hold installed protocol data (The code is here: https://github.com/cloud-hypervisor/rust-hypervisor-firmware/commit/759f4f6cf5994db8eb2ecfc6122054d533ff2ad6, but it's still work in progress). It should work without dynamic memory allocation (at least Rust's GlobalAlloc)