MCPcopy Create free account
hub / github.com/cogentcore/core / CopyFromBytes

Method CopyFromBytes

vgpu/vals.go:185–194  ·  view source on GitHub ↗

CopyFromBytes copies bytes from given source pointer into memory, and sets Mod flag. Use this for struct data types.

(srcPtr unsafe.Pointer)

Source from the content-addressed store, hash-verified

183// CopyFromBytes copies bytes from given source pointer into memory,
184// and sets Mod flag. Use this for struct data types.
185func (vl *Value) CopyFromBytes(srcPtr unsafe.Pointer) {
186 if err := vl.PaddedArrayCheck(); err != nil {
187 log.Println(err)
188 // return
189 }
190 dst := vl.Bytes()
191 src := (*[ByteCopyMemoryLimit]byte)(srcPtr)[:vl.AllocSize]
192 copy(dst, src)
193 vl.SetMod()
194}
195
196// CopyToBytes copies bytes from val to given source pointer into memory.
197// Use this for struct data types to retrieve computed results.

Callers 10

mainFunction · 0.95
mainFunction · 0.80
mainFunction · 0.80
ConfigLightsMethod · 0.80
SetViewProjectionMethod · 0.80
ConfigSysMethod · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 4

PaddedArrayCheckMethod · 0.95
BytesMethod · 0.95
SetModMethod · 0.95
PrintlnMethod · 0.80

Tested by

no test coverage detected