Improved performance
This commit is contained in:
parent
9867550c11
commit
81cc7e6a75
4 changed files with 55 additions and 56 deletions
|
@ -12,7 +12,7 @@ type Assembler struct {
|
|||
}
|
||||
|
||||
// Finalize generates the final machine code.
|
||||
func (a *Assembler) Finalize() ([]byte, []byte) {
|
||||
func (a Assembler) Finalize() ([]byte, []byte) {
|
||||
code := make([]byte, 0, len(a.Instructions)*8)
|
||||
data := make([]byte, 0, 16)
|
||||
labels := map[string]Address{}
|
||||
|
@ -139,7 +139,7 @@ func (a *Assembler) Finalize() ([]byte, []byte) {
|
|||
}
|
||||
|
||||
// Merge combines the contents of this assembler with another one.
|
||||
func (a *Assembler) Merge(b *Assembler) {
|
||||
func (a *Assembler) Merge(b Assembler) {
|
||||
a.Instructions = append(a.Instructions, b.Instructions...)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue