MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / beginCommandWrite

Function beginCommandWrite

packages/core/src/drawlist/builderBase.ts:942–967  ·  view source on GitHub ↗
(method: string, size: number)

Source from the content-addressed store, hash-verified

940 }
941
942 protected beginCommandWrite(method: string, size: number): boolean {
943 if (this.error) return false;
944
945 if (this.cmdCount + 1 > this.maxCmdCount) {
946 this.fail(
947 "ZRDL_TOO_LARGE",
948 `maxCmdCount exceeded (count=${this.cmdCount + 1}, max=${this.maxCmdCount})`,
949 );
950 return false;
951 }
952
953 if ((this.cmdLen & 3) !== 0) {
954 this.fail("ZRDL_INTERNAL", "writeCommandHeader: cmd cursor is not 4-byte aligned");
955 return false;
956 }
957
958 const required = this.cmdLen + size;
959 this.ensureCmdCapacity(required);
960 if (this.error) return false;
961
962 if (required > this.cmdBuf.byteLength) {
963 this.failCapacity(method, size);
964 return false;
965 }
966 return true;
967 }
968
969 protected failCapacity(method: string, size: number): void {
970 const required = this.cmdLen + size;

Callers

nothing calls this directly

Calls 2

failMethod · 0.80
failCapacityMethod · 0.80

Tested by

no test coverage detected