MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / computeGrownCapacityBytes

Function computeGrownCapacityBytes

src/data/createDataStore.ts:65–71  ·  view source on GitHub ↗
(currentCapacityBytes: number, requiredBytes: number)

Source from the content-addressed store, hash-verified

63}
64
65function computeGrownCapacityBytes(currentCapacityBytes: number, requiredBytes: number): number {
66 // Grow geometrically to reduce buffer churn (power-of-two policy).
67 // Enforce 4-byte alignment via MIN_BUFFER_BYTES (>= 4) and power-of-two growth.
68 const required = Math.max(MIN_BUFFER_BYTES, roundUpToMultipleOf4(requiredBytes));
69 const grown = Math.max(MIN_BUFFER_BYTES, nextPow2(required));
70 return Math.max(currentCapacityBytes, grown);
71}
72
73function fnv1aUpdate(hash: number, words: Uint32Array): number {
74 let h = hash >>> 0;

Callers 2

setSeriesFunction · 0.85
appendSeriesFunction · 0.85

Calls 2

roundUpToMultipleOf4Function · 0.85
nextPow2Function · 0.70

Tested by

no test coverage detected