| 214 | static const int MAX_CHUNK_SIZE = 512 * 1024; |
| 215 | |
| 216 | struct ChunkInfo { |
| 217 | uint8_t* data; // Owned by the ChunkInfo. |
| 218 | int64_t size; // in bytes |
| 219 | |
| 220 | /// bytes allocated via Allocate() in this chunk |
| 221 | int64_t allocated_bytes; |
| 222 | |
| 223 | explicit ChunkInfo(int64_t size, uint8_t* buf); |
| 224 | |
| 225 | ChunkInfo() |
| 226 | : data(NULL), |
| 227 | size(0), |
| 228 | allocated_bytes(0) {} |
| 229 | }; |
| 230 | |
| 231 | /// A static field used as non-NULL pointer for zero length allocations. NULL is |
| 232 | /// reserved for allocation failures. It must be as aligned as max_align_t for |