cd01979004
This moves the byte block linked list structure outside of GrMemoryPool into a new type, GrBlockAllocator. This new type is solely responsible for managing the byte blocks, tracking where the next allocation occurs, and creating/destroying the byte blocks. It also tries to encapsulate all of/most alignment related math, while making it convenient for clients to add per-allocation padding/metadata. It has added functionality compared to the original block linked list that was embedded in GrMemoryPool: - Supports resetting the entire allocator - Supports resizing the last allocation - Is able to rewind an entire stack of allocations, instead of just the last allocation. - Supports multiple block growth policies instead of just a fixed size. - Supports templated alignment, and variable alignment within a single GrBlockAllocator - Query the amount of available memory - Performs as much math as possible in 32-bit ints with static asserts that ensure overflow won't happen. Some of this flexibility was added so that the GrBlockAllocator can be used to implement an arena allocator similar to SkArenaAlloc, or to replace the use of SkTArray in GrQuadBuffer. It is also likely possible that GrAllocator can be written on top of GrBlockAllocator. I will try to perform these consolidations in later CLs. Change-Id: Ia6c8709642369b66b88eb1bc46264fb2aa9b62ab Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262216 Commit-Queue: Michael Ludwig <michaelludwig@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> |
||
---|---|---|
.. | ||
toolchain | ||
__init__.py | ||
bench.gni | ||
BUILD.gn | ||
BUILDCONFIG.gn | ||
call.py | ||
checkdir.py | ||
checkpath.py | ||
codesign_ios.py | ||
compile_ib_files.py | ||
compile_processors.py | ||
copy_git_directory.py | ||
core.gni | ||
cp.py | ||
create_sksl_enums.py | ||
effects_imagefilters.gni | ||
effects.gni | ||
find_headers.py | ||
find_msvc.py | ||
find_xcode_sysroot.py | ||
flutter_defines.gni | ||
fuchsia_defines.gni | ||
gen_plist_ios.py | ||
gm.gni | ||
gn_meta_sln.py | ||
gn_to_bp_utils.py | ||
gn_to_bp.py | ||
gn_to_cmake.py | ||
gpu.gni | ||
highest_version_dir.py | ||
ios.gni | ||
is_clang.py | ||
make_gm_gni.py | ||
opts.gni | ||
pdf.gni | ||
push_to_android.py | ||
run_sksllex.py | ||
samples.gni | ||
shared_sources.gni | ||
skia.gni | ||
sksl.gni | ||
tests.gni | ||
utils.gni | ||
xps.gni |