Reduced memory usage
This commit is contained in:
parent
d77660cdb8
commit
9867550c11
5 changed files with 42 additions and 36 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue