Revert "fix(layout): grow specs without contiguous reallocations"

This reverts commit eea6366ea2.
This commit is contained in:
2026-08-08 13:30:17 -04:00
parent eea6366ea2
commit ddcdb52bb2
+7 -6
View File
@@ -138,20 +138,21 @@ constexpr uint16_t NO_LABEL = 0xFFFF;
class Tree { class Tree {
public: public:
std::vector<Node> nodes; std::vector<Node> nodes;
std::deque<Spec> specs; std::vector<Spec> specs;
const char* error = nullptr; const char* error = nullptr;
uint16_t focus = NONE; uint16_t focus = NONE;
// Growth doubling needs the old and new node buffers live at once, which is // Growth doubling needs the old and new buffers live at once, which is the
// the allocation that fails first on a tight heap. One reservation covers a // allocation that fails first on a tight heap. One reservation covers a
// small screen so a build reallocates only if it genuinely gets large. // typical screen so a build reallocates only if it genuinely gets large.
static constexpr size_t NODE_RESERVE = 64; static constexpr size_t RESERVE = 64;
void reset() { void reset() {
focus = NONE; focus = NONE;
nodes.clear(); nodes.clear();
specs.clear(); specs.clear();
nodes.reserve(NODE_RESERVE); nodes.reserve(RESERVE);
specs.reserve(RESERVE);
labelAt.clear(); labelAt.clear();
labels.clear(); labels.clear();
styles.clear(); styles.clear();