17 pos_(0), max_size_(kMaxMemSize) {
18 data_ =
static_cast<unsigned char *
>(smalloc(size));
34 data_ =
static_cast<unsigned char *
>(srealloc(
data_, new_size));
43 return static_cast<int64_t
>(sz);
104 data_ =
static_cast<unsigned char *
>(smalloc(size));
113 std::string result =
"Memory sink with ";
virtual std::string Describe()
virtual bool Reserve(size_t size)
assert((mem||(size==0))&&"Out Of Memory")
std::string StringifyUint(const uint64_t value)
virtual int64_t Write(const void *buf, uint64_t sz)
void Adopt(size_t size, size_t pos, unsigned char *data, bool is_owner=true)