MCPcopy Create free account
hub / github.com/W4G1/multithreading / allocTemp

Method allocTemp

src/lib/json_buffer.ts:222–229  ·  view source on GitHub ↗
(size: number)

Source from the content-addressed store, hash-verified

220 const visited = new Map<number, number>();
221
222 const allocTemp = (size: number) => {
223 const ptr = freePtr;
224 freePtr = (freePtr + size + 7) & ~7;
225 if (freePtr > tempBuffer.byteLength) {
226 throw new Error("GC Fatal: Fragmentation too high");
227 }
228 return ptr;
229 };
230
231 const relocate = (oldPtr: number, type: number): number => {
232 if (oldPtr === 0) return 0;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected