base: 将通用动态数组操作接入 layout/state/config

This commit is contained in:
2026-03-24 20:09:55 +08:00
parent e7a519be6a
commit e6b4486f89
8 changed files with 31 additions and 92 deletions

View File

@@ -5,6 +5,12 @@
#include "base/memory.h"
static constexpr size_t INIT_CAPACITY = 4;
static inline size_t next_capacity(size_t capacity) {
if (capacity) return capacity * 2;
return INIT_CAPACITY;
}
/**
* @file array.h
* @brief 动态数组基础操作。