allocation system for properly aligned bytes

GrBagOfBytes parcels out bytes with a given size and alignment.
It is very careful about checking all values coming so that
no calculations overflows.

If the current block is not big enough to satisfy the request
bytes, a new block will be allocated to satisfy the
requested bytes.

Change-Id: If7b5e812f903b51ba4936605cd0dc298dda8821a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368117
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
3 files changed