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,5 +1,6 @@
#include "wrap-string.hpp"
#include "wrap-string-view.hpp"
#include "wrap-vector.hpp"
#include "driver-util.hpp"
@@ -8,9 +9,9 @@
namespace drv {
void split_host_port(std::string_view target, std::string &host, std::string &port) {
void split_host_port(drv::string_view target, drv::string &host, drv::string &port) {
size_t lastcolon = target.rfind(':');
if (lastcolon == std::string_view::npos) {
if (lastcolon == drv::string_view::npos) {
host = ""; port = ""; return;
}
host = target.substr(0, lastcolon);
@@ -20,11 +21,11 @@ void split_host_port(std::string_view target, std::string &host, std::string &po
}
}
std::vector<std::string> parse_control_lst(std::string_view ctrl) {
std::vector<std::string> result;
drv::vector<drv::string> parse_control_lst(drv::string_view ctrl) {
drv::vector<drv::string> result;
while (!ctrl.empty()) {
std::string_view line = util::sv_read_line(ctrl);
std::string_view trimmed = util::sv_trim(line);
drv::string_view line = util::sv_read_line(ctrl);
drv::string_view trimmed = util::sv_trim(line);
if ((trimmed.size() > 0) && (trimmed[0] != '#')) {
result.emplace_back(trimmed);
}
@@ -37,7 +38,7 @@ std::vector<std::string> parse_control_lst(std::string_view ctrl) {
LuaDefine(unittests_driverutil, "", "some unit tests") {
// Test split_host_port
std::string host, port;
drv::string host, port;
drv::split_host_port("stanford.edu:80", host, port);
LuaAssertStrEq(L, host, "stanford.edu");
LuaAssertStrEq(L, port, "80");