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

Added Stream as Export Attribute Macro #38

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

Conversation

chavic
Copy link
Contributor

@chavic chavic commented Sep 23, 2024

Summary

  • Enhanced Stream Support:

    • Supported various stream types and tested with simple streams, count streams, Fibonacci streams, and combined streams as seen in tests.
    • Enabled handling of custom data types and error-producing streams.
    • Updated generate_object with a new generate_stream method and macros which also incorporates Finalizer usage.
    • Removed manual drop() methods from Dart stream generators.
    • Added an optional dispose() method for manual resource management when necessary.
    • Verified normal stream emissions.
    • Tested error-producing streams.
    • Ensured proper resource cleanup.
    • Validated stream cancellation behavior.
  • Implemented Lifecycle Management:

    • Integrated Dart's Finalizer to automatically manage the disposal of Rust stream objects.
    • Prevented segmentation faults by eliminating premature drop() calls in Dart.

Fixes

  • Resolved Segmentation Faults:

    • Addressed crashes caused by premature disposal of Rust stream objects by leveraging Finalizer.
  • Prevented Memory Leaks:

    • Ensured Rust objects are properly freed after stream usage through automated lifecycle management.

Next Steps

  • Expose Additional Rust Functions:

    • Implement get_drop_counter() to monitor and verify resource cleanup in Dart tests.
  • Enhance FFI Converters:

    • Fully support complex data types and error handling between Rust and Dart.

Please review the changes and let me know if there are any adjustments

@chavic chavic requested a review from gnunicorn September 23, 2024 10:24
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.

1 participant