feat(core): 引入 plan/effect 执行骨架

新增 plan/effect 数据结构与基础操作
在 runtime 中接入 event -> command_buffer -> plan -> backend 流程
补齐 policy/backend 接口并同步更新测试构建
This commit is contained in:
2026-04-13 05:56:31 +08:00
parent 20e5e57c8c
commit 6561b16be0
11 changed files with 124 additions and 4 deletions

22
src/core/plan.c Normal file
View File

@@ -0,0 +1,22 @@
#include "core/plan.h"
#include "base/array.h"
#include "base/memory.h"
void plan_reset(plan_t *plan) {
if (!plan->effects || !plan->capacity) return;
p_clear(plan->effects, plan->capacity);
plan->count = 0;
}
void plan_cleanup(plan_t *plan) {
p_delete(&plan->effects);
plan->count = 0;
plan->capacity = 0;
}
void plan_push_effect(plan_t *plan, const effect_t *effect) {
effect_t *eft = array_push(plan->effects, plan->count, plan->capacity);
*eft = *effect;
}