MCPcopy Create free account
hub / github.com/apache/trafficserver / copyTo

Method copyTo

plugins/experimental/wasm/lib/src/context.cc:54–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54WasmResult BufferBase::copyTo(WasmBase *wasm, size_t start, size_t length, uint64_t ptr_ptr,
55 uint64_t size_ptr) const {
56 if (owned_data_) {
57 std::string_view s(owned_data_.get() + start, length);
58 if (!wasm->copyToPointerSize(s, ptr_ptr, size_ptr)) {
59 return WasmResult::InvalidMemoryAccess;
60 }
61 return WasmResult::Ok;
62 }
63 std::string_view s = data_.substr(start, length);
64 if (!wasm->copyToPointerSize(s, ptr_ptr, size_ptr)) {
65 return WasmResult::InvalidMemoryAccess;
66 }
67 return WasmResult::Ok;
68}
69
70// Test support.
71uint32_t resolveQueueForTest(std::string_view vm_id, std::string_view queue_name) {

Callers 1

get_buffer_bytesFunction · 0.45

Calls 3

copyToPointerSizeMethod · 0.80
getMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected