[sanitizer][NFC] Don't inherit InternalMmapVector

This commit is contained in:
Vitaly Buka 2021-03-16 03:55:29 -07:00
parent 596db9934b
commit 1310c686c2
1 changed files with 10 additions and 4 deletions

View File

@ -592,20 +592,26 @@ class InternalMmapVector : public InternalMmapVectorNoCtor<T> {
InternalMmapVector &operator=(InternalMmapVector &&) = delete;
};
class InternalScopedString : public InternalMmapVector<char> {
class InternalScopedString {
public:
explicit InternalScopedString(uptr max_length)
: InternalMmapVector<char>(max_length), length_(0) {
(*this)[0] = '\0';
: buffer_(max_length), length_(0) {
buffer_[0] = '\0';
}
uptr length() { return length_; }
uptr size() const { return buffer_.size(); }
uptr length() const { return length_; }
void clear() {
(*this)[0] = '\0';
length_ = 0;
}
void append(const char *format, ...);
char *data() { return buffer_.data(); }
const char *data() const { return buffer_.data(); }
char &operator[](uptr i) { return buffer_[i]; }
const char &operator[](uptr i) const { return buffer_[i]; }
private:
InternalMmapVector<char> buffer_;
uptr length_;
};