| 551 | } |
| 552 | |
| 553 | void HashStringAllocator::ensureAvailable(int32_t bytes, Position& position) { |
| 554 | if (available(position) >= bytes) { |
| 555 | return; |
| 556 | } |
| 557 | |
| 558 | ByteOutputStream stream(this); |
| 559 | extendWrite(position, stream); |
| 560 | static char data[128]; |
| 561 | while (bytes) { |
| 562 | auto written = std::min<size_t>(bytes, sizeof(data)); |
| 563 | stream.append(folly::StringPiece(data, written)); |
| 564 | bytes -= written; |
| 565 | } |
| 566 | position = finishWrite(stream, 0).first; |
| 567 | } |
| 568 | |
| 569 | inline bool HashStringAllocator::storeStringFast( |
| 570 | const char* bytes, |