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

refactor: libfastrace C++ interface for improved safety and usability #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ethercflow
Copy link
Contributor

  • Replace C-style function calls with type-safe C++ wrappers
  • Implement move semantics for Span and LocalSpan classes
  • Use call_rust_function template for safer Rust-C++ interop
  • Replace unions with reinterpret_cast for cleaner type conversions
  • Add vector-based property handling for more flexible API
  • Update examples to use new C++ interface
  • Improve memory management with RAII principles
  • Enhance code readability and maintainability

Close #3

- Replace C-style function calls with type-safe C++ wrappers
- Implement move semantics for Span and LocalSpan classes
- Use call_rust_function template for safer Rust-C++ interop
- Replace unions with reinterpret_cast for cleaner type conversions
- Add vector-based property handling for more flexible API
- Update examples to use new C++ interface
- Improve memory management with RAII principles
- Enhance code readability and maintainability

Signed-off-by: Wenbo Zhang <wenbo.zhang@iomesh.com>
@ethercflow ethercflow changed the title Refactor libfastrace C++ interface for improved safety and usability refactor: libfastrace C++ interface for improved safety and usability Oct 19, 2024
: span_(new ftr_span(ftr_create_child_span_enter_loc(name))) {}

Span::~Span() {
if (span_) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why if(span_)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andylokandy To support move constructor

Signed-off-by: Wenbo Zhang <wenbo.zhang@iomesh.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modernize and enhance the libfastrace C++ API
3 participants