Reduced memory usage
This commit is contained in:
@ -10,7 +10,7 @@ import (
|
||||
type Result struct {
|
||||
Used []*Function
|
||||
Unused map[string]*Function
|
||||
instructionCount int
|
||||
InstructionCount int
|
||||
}
|
||||
|
||||
// Finalize generates the final machine code.
|
||||
@ -20,7 +20,7 @@ func (r Result) Finalize() ([]byte, []byte) {
|
||||
// The reason we call `main` instead of using `main` itself is to place
|
||||
// a return address on the stack, which allows return statements in `main`.
|
||||
final := asm.Assembler{
|
||||
Instructions: make([]asm.Instruction, 0, r.instructionCount+4),
|
||||
Instructions: make([]asm.Instruction, 0, r.InstructionCount+4),
|
||||
}
|
||||
|
||||
final.Call("main")
|
||||
|
Reference in New Issue
Block a user