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

@@ -6,8 +6,8 @@
#include "invocation.hpp"
const std::string &InvocationData::get(const std::string &key) const {
static std::string blank_;
const eng::string &InvocationData::get(const eng::string &key) const {
static eng::string blank_;
auto iter = find(key);
if (iter == end()) {
return blank_;
@@ -29,18 +29,18 @@ void InvocationData::deserialize(StreamBuffer *sb) {
clear();
int size = sb->read_uint16();
for (int i = 0; i < size; i++) {
std::string key = sb->read_string();
std::string val = sb->read_string();
eng::string key = sb->read_string();
eng::string val = sb->read_string();
(*this)[key] = val;
}
}
Invocation::Invocation() : kind_(KIND_INVALID), actor_(0), place_(0) {}
Invocation::Invocation(Kind kind, int64_t actor, int64_t place, const std::string &action, const InvocationData &data)
Invocation::Invocation(Kind kind, int64_t actor, int64_t place, const eng::string &action, const InvocationData &data)
: kind_(kind), actor_(actor), place_(place), action_(action), data_(data) {}
Invocation::Invocation(Kind kind, int64_t actor, int64_t place, const std::string &action)
Invocation::Invocation(Kind kind, int64_t actor, int64_t place, const eng::string &action)
: kind_(kind), actor_(actor), place_(place), action_(action) {}
void Invocation::serialize(StreamBuffer *sb) const {
@@ -59,8 +59,8 @@ void Invocation::deserialize(StreamBuffer *sb) {
data_.deserialize(sb);
}
std::string Invocation::debug_string() {
std::ostringstream oss;
eng::string Invocation::debug_string() {
eng::ostringstream oss;
oss << "inv[";
switch (kind_) {
case KIND_INVALID: oss << "invalid"; break;