To make this possible, the logic for maintaining a pool of a given node
size has been split into a separate `Subpool` class. We now have two
Subpool objects in the PoolData class; they are always adjacent in
memory, and we can still identify a pooled node just as easily by
verifying that the pointer address is within the range of one of our
Subpools. (Identifying which subpool requires one extra check.)
This change will allow us to pool a handful of larger allocations, which
will benefit almost every program since a handful of variables and
functions are universally necessary, even in simple code.
For now, the chosen size of a large node is just a guess (2x the small
node size); this can be adjusted easily once we have a better idea of
the expected sizes for our larger IRNodes, but for now this successfully
catches a significant number of allocations in `sksl_medium` and
`sksl_large`.
Change-Id: I08fb9c55c02162d4b56e72ff4e0923f2cf258651
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330124
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>