neverchanje commented on a change in pull request #686:
URL: https://github.com/apache/incubator-pegasus/pull/686#discussion_r564222179
##########
File path: src/redis_protocol/proxy_lib/redis_parser.cpp
##########
@@ -299,10 +299,7 @@ bool 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::tls_trans_malloc(_current_str.length));
- std::shared_ptr<char> str_data(ptr,
- [](char *ptr) {
dsn::tls_trans_free(ptr); });
+ auto
str_data(dsn::utils::make_shared_array<char>(_current_str.length));
Review comment:
I doubt that auto type infer could be a high version gcc feature.
Try this:
```
std::string str_data('\0', _current_str.length);
eat_all(str_data.data(), _current_str.length);
_current_str.data = blob::create_from_bytes(std::move(str_data));
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]