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

Method FreeHost

vgpu/image.go:726–735  ·  view source on GitHub ↗

FreeHost frees memory in host buffer representation of image Only if we own the host buffer.

()

Source from the content-addressed store, hash-verified

724// FreeHost frees memory in host buffer representation of image
725// Only if we own the host buffer.
726func (im *Image) FreeHost() {
727 if im.Host.Size == 0 || !im.IsHostOwner() {
728 return
729 }
730 im.SetFlag(false, ImageOwnsHost)
731 vk.UnmapMemory(im.Dev, im.Host.Mem)
732 FreeBuffMem(im.Dev, &im.Host.Mem)
733 DestroyBuffer(im.Dev, &im.Host.Buff)
734 im.Host.SetNil()
735}
736
737// Destroy destroys any existing view, nils fields
738func (im *Image) Destroy() {

Callers 2

DestroyMethod · 0.95
AllocHostMethod · 0.95

Calls 5

IsHostOwnerMethod · 0.95
SetFlagMethod · 0.95
FreeBuffMemFunction · 0.85
DestroyBufferFunction · 0.85
SetNilMethod · 0.45

Tested by

no test coverage detected