Reduced memory allocations
This commit is contained in:
parent
58eed722c1
commit
814364612f
3 changed files with 11 additions and 3 deletions
|
@ -13,3 +13,12 @@ func (a *Assembler) Merge(b Assembler) {
|
|||
maps.Copy(a.Data, b.Data)
|
||||
a.Instructions = append(a.Instructions, b.Instructions...)
|
||||
}
|
||||
|
||||
// SetData sets the data for the given label.
|
||||
func (a *Assembler) SetData(label string, data []byte) {
|
||||
if a.Data == nil {
|
||||
a.Data = map[string][]byte{}
|
||||
}
|
||||
|
||||
a.Data[label] = data
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue