未验证 提交 07811fce 编写于 作者: Q QinZuoyan 提交者: GitHub

update rdsn: refactor tls memory allocator (#24)

上级 fc994603
Subproject commit 76733c19076222629a46450fc339ec6fe2894e8e
Subproject commit a1cb64b1b422d2a92d414963c2554bf594777ba3
......@@ -249,8 +249,9 @@ void redis_parser::parse_stream()
// string content + CR + LF
if (total_length >= current_str.length + 2) {
if (current_str.length > 0) {
char *ptr = reinterpret_cast<char *>(dsn_transient_malloc(current_str.length));
std::shared_ptr<char> str_data(ptr, [](char *ptr) { dsn_transient_free(ptr); });
char *ptr = reinterpret_cast<char *>(dsn::tls_trans_malloc(current_str.length));
std::shared_ptr<char> str_data(ptr,
[](char *ptr) { dsn::tls_trans_free(ptr); });
eat_all(str_data.get(), current_str.length);
current_str.data.assign(std::move(str_data), 0, current_str.length);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册