MCPcopy Create free account
hub / github.com/category-labs/monad / copy_code

Method copy_code

category/vm/interpreter/intercode.hpp:79–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77 }
78
79 [[gnu::always_inline]]
80 size_t copy_code(
81 size_t const offset, uint8_t *const buffer,
82 size_t const buffer_size) const
83 {
84 auto const code_size = size();
85 if (offset > code_size) {
86 return 0;
87 }
88 auto const n = std::min(code_size - offset, buffer_size);
89 std::copy_n(code() + offset, n, buffer);
90 return n;
91 }
92
93 private:
94 uint8_t const *padded_code_;

Callers 2

extcodecopyFunction · 0.45
resolve_delegationFunction · 0.45

Calls 2

sizeFunction · 0.50
minFunction · 0.50

Tested by

no test coverage detected