MCPcopy Create free account
hub / github.com/apache/fory / serializeStringFast

Function serializeStringFast

javascript/packages/hps/src/fastcall.cc:129–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129static uint32_t serializeStringFast(Local<Value> receiver,
130 const v8::FastApiTypedArray<uint8_t> &dst,
131 const v8::FastOneByteString &src,
132 uint32_t offset, uint32_t max_length) {
133 uint8_t *dst_data;
134 dst.getStorageIfAligned(&dst_data);
135 offset += writeVarUint32(dst_data, offset,
136 (src.length << 2 | Encoding::LATIN1)); // length
137 memcpy(dst_data + offset, src.data, src.length);
138 return offset + src.length;
139}
140
141v8::CFunction fast_serialize_string(v8::CFunction::Make(serializeStringFast));
142

Callers

nothing calls this directly

Calls 1

writeVarUint32Function · 0.85

Tested by

no test coverage detected