Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Next

* Fixed small memory leak of a VectorData wrapper when converting to HLO/StableHLO (#31).
* Fixed leak when destroying XlaBuilder.

# v0.6.2 - 2025/02/26

Expand Down
3 changes: 2 additions & 1 deletion xlabuilder/xlabuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ func (b *XlaBuilder) Destroy() {
if b.IsNil() {
return
}
cXlaBuilder := b.cXlaBuilder
b.cXlaBuilder = nil
b.parent = nil // Help the GC just in case.
for _, subComp := range b.cachedStandardComputations {
subComp.Destroy()
}
b.cachedStandardComputations = nil
C.XlaBuilderDestroy(unsafe.Pointer(b.cXlaBuilder))
C.XlaBuilderDestroy(unsafe.Pointer(cXlaBuilder))
}

// Name returns the name after it was canonicalized by the XlaBuilder library -- so it may be different from the
Expand Down
Loading