mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-18 03:24:00 +00:00
builder: free LLVM objects after use
This reduces the TinyGo memory consumption when running make tinygo-test from 5.8GB to around 2GB on my laptop.
This commit is contained in:
committed by
Ron Evans
parent
ea3b5dc689
commit
777d3f3ea5
@@ -114,7 +114,9 @@ func OptimizeReflectImplements(mod llvm.Module) {
|
||||
defer builder.Dispose()
|
||||
|
||||
// Get a few useful object for use later.
|
||||
uintptrType := mod.Context().IntType(llvm.NewTargetData(mod.DataLayout()).PointerSize() * 8)
|
||||
targetData := llvm.NewTargetData(mod.DataLayout())
|
||||
defer targetData.Dispose()
|
||||
uintptrType := mod.Context().IntType(targetData.PointerSize() * 8)
|
||||
|
||||
// Look up the (reflect.Value).Implements() method.
|
||||
var implementsFunc llvm.Value
|
||||
|
||||
Reference in New Issue
Block a user