MCPcopy Create free account
hub / github.com/nodejs/node / ensure_space

Method ensure_space

deps/v8/test/mjsunit/wasm/wasm-module-builder.js:1125–1132  ·  view source on GitHub ↗
(needed)

Source from the content-addressed store, hash-verified

1123 }
1124
1125 ensure_space(needed) {
1126 if (this.buffer.length - this.length >= needed) return;
1127 let new_capacity = this.buffer.length * 2;
1128 while (new_capacity - this.length < needed) new_capacity *= 2;
1129 let new_buffer = new Uint8Array(new_capacity);
1130 new_buffer.set(this.buffer);
1131 this.buffer = new_buffer;
1132 }
1133
1134 trunc_buffer() {
1135 return new Uint8Array(this.buffer.buffer, 0, this.length);

Callers 5

emit_u8Method · 0.95
emit_u16Method · 0.95
emit_u32Method · 0.95
emit_leb_uMethod · 0.95
emit_bytesMethod · 0.95

Calls 1

setMethod · 0.45

Tested by

no test coverage detected