modm-io / modm

modm: a C++23 library generator for AVR and ARM Cortex-M devices
https://modm.io
Mozilla Public License 2.0
748 stars 132 forks source link

[UI] Configurable Allocator for modm::ViewStack #1184

Closed MatthewMArnold closed 2 months ago

MatthewMArnold commented 3 months ago

Having a custom allocator allows users to control how modm::AbstractView elements stored by the view stack are allocated. This for example, allows the user to statically allocate all views and removes the memory and processing overhead of dynamically allocating views. For an example, see aruw-mcb's MainMenu class. By default, a dynamic allocator used, so default behavior remains unchanged.

This also has a couple minor tweaks to other UI related components.

This is a follow-on to https://github.com/modm-io/modm/pull/949 and https://github.com/salkinium/modm/tree/JoshuaT/ModmUpgrade2 that contains outstanding commits that were never applied cherry-picked on top of latest modm-io/modm develop.

MatthewMArnold commented 3 months ago

@OroArmor @calebchalmers here you go

salkinium commented 3 months ago

The fixup is still there. Try git rebase -i develop to apply the fixup to the right commit.

MatthewMArnold commented 3 months ago

The fixup is still there. Try git rebase -i develop to apply the fixup to the right commit.

Ah I misunderstood what you were asking, should be done now