26 if constexpr (
sizeof(size_t) > 4) {
33void DisplayListStorage::realloc(
size_t count) {
34 ptr_.reset(
static_cast<uint8_t*
>(std::realloc(ptr_.release(), count)));
40 if (used_ + needed > allocated_) {
42 "This math needs updating for non-pow2.");
46 size_t old_size = allocated_;
52 memset(ptr_.get() + used_, 0, allocated_ - old_size);
54 uint8_t* ret = ptr_.get() + used_;
61 ptr_ = std::move(source.ptr_);
63 allocated_ = source.allocated_;
65 source.allocated_ = 0u;
75 ptr_ = std::move(source.ptr_);
77 allocated_ = source.allocated_;
79 source.allocated_ = 0u;
void reset()
Resets the storage and allocation of the object to an empty state.
DisplayListStorage & operator=(DisplayListStorage &&other)
static size_t NextPowerOfTwoSize(size_t x)
Compute the next power of two from [x].
DisplayListStorage()=default
uint8_t * allocate(size_t needed)
static const constexpr size_t kDLPageSize
#define FML_CHECK(condition)
static constexpr bool is_power_of_two(int value)