Reduced memory allocations
This commit is contained in:
parent
58eed722c1
commit
814364612f
3 changed files with 11 additions and 3 deletions
|
@ -40,8 +40,8 @@ func (f *Function) TokenToRegister(t token.Token, register cpu.Register) error {
|
|||
case token.String:
|
||||
f.count.data++
|
||||
label := fmt.Sprintf("%s_data_%d", f.Name, f.count.data)
|
||||
value := t.Text()[1 : len(t.Bytes)-1]
|
||||
f.assembler.Data[label] = []byte(value)
|
||||
value := t.Bytes[1 : len(t.Bytes)-1]
|
||||
f.assembler.SetData(label, value)
|
||||
f.RegisterLabel(asm.MOVE, register, label)
|
||||
return nil
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue