MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / fillRefs

Method fillRefs

include/runtime/instance/table.h:140–153  ·  view source on GitHub ↗

Fill the Refs[Offset : Offset + Length - 1] by Val.

Source from the content-addressed store, hash-verified

138
139 /// Fill the Refs[Offset : Offset + Length - 1] by Val.
140 Expect<void> fillRefs(const RefVariant &Val, const uint64_t Offset,
141 const uint64_t Length) noexcept {
142 // Check the accessing boundary.
143 if (!checkAccessBound(Offset, Length)) {
144 spdlog::error(ErrCode::Value::TableOutOfBounds);
145 spdlog::error(ErrInfo::InfoBoundary(Offset, Length, getSize()));
146 return Unexpect(ErrCode::Value::TableOutOfBounds);
147 }
148
149 // Fill the references.
150 std::fill_n(Refs.begin() + static_cast<std::ptrdiff_t>(Offset), Length,
151 Val);
152 return {};
153 }
154
155 /// Get the elem address.
156 Expect<RefVariant> getRefAddr(const uint64_t Idx) const noexcept {

Callers 2

runTableFillOpMethod · 0.80
proxyTableFillMethod · 0.80

Calls 4

InfoBoundaryClass · 0.85
UnexpectFunction · 0.85
errorFunction · 0.50
beginMethod · 0.45

Tested by

no test coverage detected