Zero bytes in padding, i.e. bytes between size_ and capacity_.
| 137 | |
| 138 | /// Zero bytes in padding, i.e. bytes between size_ and capacity_. |
| 139 | void ZeroPadding() { |
| 140 | #ifndef NDEBUG |
| 141 | CheckMutable(); |
| 142 | #endif |
| 143 | // A zero-capacity buffer can have a null data pointer |
| 144 | if (capacity_ != 0) { |
| 145 | memset(mutable_data() + size_, 0, static_cast<size_t>(capacity_ - size_)); |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | /// \brief Construct an immutable buffer that takes ownership of the contents |
| 150 | /// of an std::string (without copying it). |
nothing calls this directly
no test coverage detected