- std::pair<void*,uint32_t> preallocate(
- uint32_t min, uint32_t newAllocationSize,
- uint32_t max = std::numeric_limits<uint32_t>::max());
+ std::pair<void*,uint64_t> preallocate(
+ uint64_t min, uint64_t newAllocationSize,
+ uint64_t max = std::numeric_limits<uint64_t>::max()) {
+ auto buf = tailBuf();
+ if (LIKELY(buf && buf->tailroom() >= min)) {
+ return std::make_pair(buf->writableTail(),
+ std::min(max, buf->tailroom()));
+ }
+
+ return preallocateSlow(min, newAllocationSize, max);
+ }