protocompile
protocompile copied to clipboard
Add inline and small slices for memory compaction
Go's slices are quite large: 24 bytes on most platforms that will run Protocompile. We can use these bytes to store integer data inline, instead of having to make an allocation for each non-empty slice.
This PR adds slicesx.Inline, which is a slice of integers that stores very small arrays where the length/capacity would normally live. It also adds slicesx.Small, which is a slice without a capacity; this will be useful for the IR package, which will tend to have more immutable slices in it.