/** * @holoscript/core LOD Memory Pool * * Memory pooling system for LOD meshes to reduce allocations * and improve performance through buffer reuse. * * v3.5 Performance Optimization */ export interface PooledBuffer { id: string; vertices: Float32Array; indices: Uint32Array; normals?: Float32Array; uvs?: Float32Array; inUse: boolean; lastUsed: number; size: number; } export interface PoolStatistics { totalBuffers: number; buffersInUse: number; buffersAvailable: number; totalMemoryBytes: number; usedMemoryBytes: number; availableMemoryBytes: number; allocationCount: number; reuseCount: number; defragmentationCount: number; hitRate: number; } export interface MemoryPoolOptions { initialPoolSize: number; maxPoolSize: number; bufferSizes: number[]; enableDefragmentation: boolean; defragmentationThreshold: number; memoryPressureThreshold: number; autoAdjustLODBias: boolean; } /** * Memory pool for pre-allocated mesh buffers */ export declare class LODMemoryPool { private options; private pools; private stats; private nextBufferId; private memoryPressureCallbacks; constructor(options?: Partial); /** * Initialize buffer pools for each size tier */ private initializePools; /** * Create a new pooled buffer */ private createBuffer; /** * Acquire a buffer from the pool */ acquire(vertexCount: number): PooledBuffer | null; /** * Release a buffer back to the pool */ release(buffer: PooledBuffer): void; /** * Release buffer by ID */ releaseById(bufferId: string): void; /** * Find appropriate size tier for requested vertex count */ private findSizeTier; /** * Defragment memory pools */ defragment(): void; /** * Check memory pressure and trigger callbacks */ private checkMemoryPressure; /** * Calculate current memory pressure (0-1) */ getMemoryPressure(): number; /** * Register memory pressure callback */ onMemoryPressure(callback: (pressure: number) => void): () => void; /** * Create empty statistics object */ private createEmptyStats; /** * Update pool statistics */ private updateStatistics; /** * Get pool statistics */ getStatistics(): PoolStatistics; /** * Get formatted statistics */ getFormattedStatistics(): string; /** * Clear all pools */ clear(): void; /** * Reset pools to initial state */ reset(): void; /** * Get pool for specific size */ getPool(size: number): PooledBuffer[] | undefined; /** * Get all pool sizes */ getPoolSizes(): number[]; /** * Set options */ setOptions(options: Partial): void; /** * Get options */ getOptions(): MemoryPoolOptions; } /** * Create memory pool with default options */ export declare function createLODMemoryPool(options?: Partial): LODMemoryPool; /** * Create memory pool optimized for VR */ export declare function createVRMemoryPool(): LODMemoryPool; /** * Create memory pool optimized for mobile */ export declare function createMobileMemoryPool(): LODMemoryPool; //# sourceMappingURL=LODMemoryPool.d.ts.map