Migrated engine to using dlmalloc through eng::

This commit is contained in:
2022-02-24 02:17:41 -05:00
parent acc00289fb
commit f467944095
61 changed files with 631 additions and 590 deletions

View File

@@ -1,13 +1,12 @@
#include "wrap-map.hpp"
#include "wrap-sstream.hpp"
#include "wrap-ostream.hpp"
#include "wrap-deque.hpp"
#include "wrap-ostream.hpp"
#include "idalloc.hpp"
static bool ranges_equal(const std::deque<int64_t> &dq, int64_t a, int64_t b, int64_t c) {
static bool ranges_equal(const eng::deque<int64_t> &dq, int64_t a, int64_t b, int64_t c) {
if (dq.size() != 3) return false;
if (dq[0] != a) return false;
if (dq[1] != b) return false;
@@ -82,8 +81,8 @@ void IdGlobalPool::deserialize(StreamBuffer *sb) {
}
}
std::string IdGlobalPool::debug_string() const {
std::ostringstream oss;
eng::string IdGlobalPool::debug_string() const {
eng::ostringstream oss;
oss << "next_batch:" << util::hex64() << next_batch_ << " ";
oss << "next_id:" << util::hex64() << next_id_ << " ";
oss << "salvaged:";
@@ -196,7 +195,7 @@ void IdPlayerPool::diff(const IdPlayerPool &auth, StreamBuffer *sb) const {
sb->write_uint8(auth.ranges_.size());
// Build up an index of the known IDs.
std::map<int64_t, int> index;
eng::map<int64_t, int> index;
for (int i = 0; i < int(ranges_.size()); i++) {
index[ranges_[i]] = i;
}
@@ -225,7 +224,7 @@ void IdPlayerPool::patch(StreamBuffer *sb, DebugCollector *dbc) {
DebugLine(dbc) << "IdPlayerPool modified";
fifo_capacity_ = fifo_cap;
int nranges = sb->read_uint8();
std::deque<int64_t> old = std::move(ranges_);
eng::deque<int64_t> old = std::move(ranges_);
ranges_.clear();
for (int i = 0; i < nranges; i++) {
int index = sb->read_uint8();
@@ -238,8 +237,8 @@ void IdPlayerPool::patch(StreamBuffer *sb, DebugCollector *dbc) {
}
}
std::string IdPlayerPool::debug_string() const {
std::ostringstream oss;
eng::string IdPlayerPool::debug_string() const {
eng::ostringstream oss;
oss << "cap:" << fifo_capacity_ << " ids:";
for (int i = 0; i < int(ranges_.size()); i++) {
if (i > 0) oss << ",";