- Crear src/utils/time.zig para centralizar helpers de tiempo (timestamp, milliTimestamp, nanoTimestamp).
- Reemplazar std.io.fixedBufferStream por std.Io.Writer.fixed.
- Migrar de std.fs.cwd() a std.Io.Dir.cwd() y actualizar firmas de lectura/escritura.
- Reemplazar std.Thread.sleep por std.posix.system.nanosleep.
- Corregir capturas descartadas en switches (text_input => {}).
- Actualizar tests y ejemplos para compatibilidad con std.Io y nuevos helpers.
- Actualizar build.zig.zon a 0.16.0.
Co-Authored-By: Gemini <noreply@google.com>
50 lines
1.6 KiB
Zig
50 lines
1.6 KiB
Zig
//! Utils Module
|
|
//!
|
|
//! High-performance utilities for memory management, object pooling, and benchmarking.
|
|
//!
|
|
//! ## Components
|
|
//! - **FrameArena**: Per-frame arena allocator with O(1) reset
|
|
//! - **ObjectPool**: Generic object pool for frequently reused objects
|
|
//! - **CommandPool**: Specialized pool for draw commands
|
|
//! - **RingBuffer**: Circular buffer for streaming data
|
|
//! - **Benchmark**: Performance benchmarking utilities
|
|
|
|
pub const arena = @import("arena.zig");
|
|
pub const pool = @import("pool.zig");
|
|
pub const benchmark = @import("benchmark.zig");
|
|
pub const testing_utils = @import("testing.zig");
|
|
pub const time = @import("time.zig");
|
|
|
|
// Re-exports
|
|
pub const FrameArena = arena.FrameArena;
|
|
pub const ScopedArena = arena.ScopedArena;
|
|
|
|
pub const ObjectPool = pool.ObjectPool;
|
|
pub const CommandPool = pool.CommandPool;
|
|
pub const RingBuffer = pool.RingBuffer;
|
|
|
|
pub const Benchmark = benchmark.Benchmark;
|
|
pub const Timer = benchmark.Timer;
|
|
pub const FrameTimer = benchmark.FrameTimer;
|
|
pub const AllocationTracker = benchmark.AllocationTracker;
|
|
|
|
pub const timestamp = time.timestamp;
|
|
pub const milliTimestamp = time.milliTimestamp;
|
|
pub const nanoTimestamp = time.nanoTimestamp;
|
|
|
|
// Testing utilities
|
|
pub const TestRunner = testing_utils.TestRunner;
|
|
pub const SnapshotTester = testing_utils.SnapshotTester;
|
|
pub const CompareResult = testing_utils.CompareResult;
|
|
pub const Assertions = testing_utils.Assertions;
|
|
|
|
// =============================================================================
|
|
// Tests
|
|
// =============================================================================
|
|
|
|
test {
|
|
_ = arena;
|
|
_ = pool;
|
|
_ = benchmark;
|
|
_ = testing_utils;
|
|
}
|