15 #include "../core/alloc_func.hpp"
71 static const size_t header_size =
sizeof(
BlobHeader);
116 if (min_alloc < (1 << 9)) {
117 if (min_alloc < (1 << 5))
return (1 << 5);
118 return (min_alloc < (1 << 7)) ? (1 << 7) : (1 << 9);
120 if (min_alloc < (1 << 15)) {
121 if (min_alloc < (1 << 11))
return (1 << 11);
122 return (min_alloc < (1 << 13)) ? (1 << 13) : (1 << 15);
124 if (min_alloc < (1 << 20)) {
125 if (min_alloc < (1 << 17))
return (1 << 17);
126 return (min_alloc < (1 << 19)) ? (1 << 19) : (1 << 20);
128 min_alloc = (min_alloc | ((1 << 20) - 1)) + 1;
223 memcpy(
Append(num_bytes), p, num_bytes);
241 size_t new_size =
Length() + num_bytes;
252 byte *pNewData =
Prepare(num_bytes);
263 assert(new_size < SIZE_MAX - header_size -
tail_reserve);
272 if (tmp->
items != 0) {
304 template <
typename T>
310 static const size_t type_size =
sizeof(T);
338 assert(index <
Size());
357 return (
Data() + index);
361 inline const T *
Data(
size_t index)
const
364 return (
Data() + index);
400 inline OnTransfer Transfer()
402 return OnTransfer(*
this);