More work on moving engine into dlmalloc heap

This commit is contained in:
2022-02-25 19:57:23 -05:00
parent 08f6aa2092
commit ff932dba10
52 changed files with 351 additions and 484 deletions

View File

@@ -8,10 +8,9 @@
#include "luastack.hpp"
#include "util.hpp"
namespace drv {
void split_host_port(std::string_view target, drv::string &host, drv::string &port) {
void split_host_port(std::string_view target, std::string &host, std::string &port) {
size_t lastcolon = target.rfind(':');
if (lastcolon == std::string_view::npos) {
host = ""; port = ""; return;
@@ -23,8 +22,8 @@ void split_host_port(std::string_view target, drv::string &host, drv::string &po
}
}
drv::vector<drv::string> parse_control_lst(std::string_view ctrl) {
drv::vector<drv::string> result;
std::vector<std::string> parse_control_lst(std::string_view ctrl) {
std::vector<std::string> result;
while (!ctrl.empty()) {
std::string_view line = util::sv_read_line(ctrl);
std::string_view trimmed = util::sv_trim(line);
@@ -40,7 +39,7 @@ drv::vector<drv::string> parse_control_lst(std::string_view ctrl) {
LuaDefine(unittests_driverutil, "", "some unit tests") {
// Test split_host_port
drv::string host, port;
std::string host, port;
drv::split_host_port("stanford.edu:80", host, port);
LuaAssertStrEq(L, host, "stanford.edu");
LuaAssertStrEq(L, port, "80");