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

Method allocObject

src/lib/json_buffer.ts:566–575  ·  view source on GitHub ↗
(initialCap: number)

Source from the content-addressed store, hash-verified

564 }
565
566 private allocObject(initialCap: number): number {
567 const capacity = Math.max(4, initialCap);
568 const byteSize = 12 + capacity * 12;
569 const ptr = this.alloc(byteSize);
570 const idx = ptr >> 2;
571 this.u32[idx] = TYPE_OBJECT;
572 this.u32[idx + 1] = capacity;
573 this.u32[idx + 2] = 0;
574 return ptr;
575 }
576
577 private allocArray(initialCap: number): number {
578 const capacity = Math.max(4, initialCap);

Callers 2

initializeBufferMethod · 0.95
writeValueMethod · 0.95

Calls 1

allocMethod · 0.95

Tested by

no test coverage detected