feat: 实现 ArgonMemoryManager 内存管理类

- 实现构造函数和 ID 跟踪集合(timers, intervals, frames)
- 实现 setTimeout()、setInterval()、requestAnimationFrame() 包装方法
- 实现对应的清理方法(clearTimeout, clearInterval, cancelAnimationFrame)
- 实现 clearAll() 统一清理接口
- 实现 getStats() 获取统计信息
- 创建完整的 HTML 测试文件验证功能
- 支持参数传递给回调函数
- 自动跟踪和清理,避免内存泄漏

验证需求:
- 需求 12.5: 闭包引用大型对象时仅保存必要属性
- 需求 13.4: 组件销毁或页面切换时取消所有定时器和动画帧
This commit is contained in:
2026-01-21 23:29:55 +08:00
parent f165fac420
commit d33f343475
4 changed files with 952 additions and 1 deletions

View File

@@ -101,7 +101,7 @@
- **验证:需求 5.2, 5.3, 5.5**
- [~] 7. 实现内存管理模块
- [~] 7.1 创建 ArgonMemoryManager 类
- [x] 7.1 创建 ArgonMemoryManager 类
- 实现构造函数和 ID 跟踪集合
- 实现 setTimeout()、setInterval()、requestAnimationFrame() 包装方法
- 实现对应的清理方法