It turns out there's a specialised kind of array specifically for this.