Revert "fix(layout): grow specs without contiguous reallocations"
This reverts commit eea6366ea2.
This commit is contained in:
@@ -138,20 +138,21 @@ constexpr uint16_t NO_LABEL = 0xFFFF;
|
||||
class Tree {
|
||||
public:
|
||||
std::vector<Node> nodes;
|
||||
std::deque<Spec> specs;
|
||||
std::vector<Spec> specs;
|
||||
const char* error = nullptr;
|
||||
uint16_t focus = NONE;
|
||||
|
||||
// Growth doubling needs the old and new node buffers live at once, which is
|
||||
// the allocation that fails first on a tight heap. One reservation covers a
|
||||
// small screen so a build reallocates only if it genuinely gets large.
|
||||
static constexpr size_t NODE_RESERVE = 64;
|
||||
// Growth doubling needs the old and new buffers live at once, which is the
|
||||
// allocation that fails first on a tight heap. One reservation covers a
|
||||
// typical screen so a build reallocates only if it genuinely gets large.
|
||||
static constexpr size_t RESERVE = 64;
|
||||
|
||||
void reset() {
|
||||
focus = NONE;
|
||||
nodes.clear();
|
||||
specs.clear();
|
||||
nodes.reserve(NODE_RESERVE);
|
||||
nodes.reserve(RESERVE);
|
||||
specs.reserve(RESERVE);
|
||||
labelAt.clear();
|
||||
labels.clear();
|
||||
styles.clear();
|
||||
|
||||
Reference in New Issue
Block a user