Migrated engine to using dlmalloc through eng::
This commit is contained in:
@@ -121,7 +121,7 @@
|
||||
// try {
|
||||
// // Parse the message.
|
||||
// int32_t value1 = streambuffer.read_int32();
|
||||
// std::string value2 = streambuffer.read_string(maxlen);
|
||||
// eng::string value2 = streambuffer.read_string(maxlen);
|
||||
// int64_t value3 = streambuffer.read_int64();
|
||||
//
|
||||
// // Great! I got the whole message.
|
||||
@@ -252,7 +252,7 @@ public:
|
||||
StreamBuffer(const char *s, int64_t len);
|
||||
|
||||
// Construct a streambuffer that reads from an external block of bytes.
|
||||
StreamBuffer(const std::string &data);
|
||||
StreamBuffer(const eng::string &data);
|
||||
|
||||
// Delete a StreamBuffer.
|
||||
~StreamBuffer();
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
// Attempt to do a "readline". If there is no newline in
|
||||
// the buffer, returns empty string. If there is a newline,
|
||||
// returns a block of text that ends in newline.
|
||||
std::string readline();
|
||||
eng::string readline();
|
||||
|
||||
// Write block of bytes into the buffer.
|
||||
//
|
||||
@@ -284,7 +284,7 @@ public:
|
||||
// It just writes the bytes.
|
||||
//
|
||||
void write_bytes(const char *bytes, int64_t len);
|
||||
void write_bytes(const std::string &bytes);
|
||||
void write_bytes(const eng::string &bytes);
|
||||
|
||||
// Read a block of bytes from the buffer.
|
||||
//
|
||||
@@ -333,7 +333,7 @@ public:
|
||||
//
|
||||
void write_bool(bool b) { write_int8(b ? 1 : 0); }
|
||||
void write_hashvalue(const util::HashValue &hv);
|
||||
void write_string(const std::string &s);
|
||||
void write_string(const eng::string &s);
|
||||
|
||||
// Read other types from the buffer.
|
||||
//
|
||||
@@ -343,12 +343,12 @@ public:
|
||||
//
|
||||
bool read_bool() { return read_int8(); }
|
||||
util::HashValue read_hashvalue();
|
||||
std::string read_string();
|
||||
std::string read_string_limit(int64_t max_allowed);
|
||||
eng::string read_string();
|
||||
eng::string read_string_limit(int64_t max_allowed);
|
||||
|
||||
// Read the entire contents of the buffer as a string.
|
||||
//
|
||||
std::string read_entire_contents();
|
||||
eng::string read_entire_contents();
|
||||
|
||||
// Overwrite values previously written to the buffer.
|
||||
//
|
||||
@@ -404,7 +404,7 @@ public:
|
||||
void *lua_reader_ud(int64_t bytes);
|
||||
|
||||
// Get an ostream that writes into the StreamBuffer.
|
||||
std::ostream &ostream();
|
||||
eng::ostream &ostream();
|
||||
|
||||
private:
|
||||
// Start and end of the allocated block.
|
||||
@@ -429,7 +429,7 @@ private:
|
||||
int64_t lua_reader_size_;
|
||||
|
||||
// The ostream. Only allocated on demand.
|
||||
std::unique_ptr<std::ostream> ostream_;
|
||||
eng::unique_ptr<eng::ostream> ostream_;
|
||||
|
||||
// Initialize with a new buffer.
|
||||
void init(bool fixed, bool owned, char *buf, int64_t size);
|
||||
|
||||
Reference in New Issue
Block a user