Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msg/async: avoid referencing the temporary string #20640

Merged
merged 1 commit into from Mar 1, 2018

Conversation

tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Feb 28, 2018

  • get_val<std::string>(...) returns a temporary std::string, so we cannot
    keep a reference to it after evaluating this method. so convert it to
    an integer right away in the same expression.
  • use std::stoull() with base = 16, so we can parse a hex string
    representing up to 64 bits.

Signed-off-by: Kefu Chai kchai@redhat.com

* get_val<std::string>(...) returns a temporary std::string, so we cannot
  keep a reference to it after evaluating this method. so convert it to
  an integer right away in the same expression.
* use std::stoull() with base = 16, so we can parse a hex string
  representing up to 64 bits.

Signed-off-by: Kefu Chai <kchai@redhat.com>
@tchaikov
Copy link
Contributor Author

@liu-chunmei in case you are interested.

@tchaikov
Copy link
Contributor Author

retest this please

@tchaikov
Copy link
Contributor Author

tchaikov commented Mar 1, 2018

@tchaikov tchaikov merged commit e1c23cd into ceph:master Mar 1, 2018
@tchaikov tchaikov deleted the wip-async-dpdk-temp-str branch March 1, 2018 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants