core icon indicating copy to clipboard operation
core copied to clipboard

fix(rs-port): wrong implemenetation for user data in MetacallFuture

Open hulxv opened this issue 1 year ago • 2 comments

Description

Please include a summary of the change and which issue is fixed. List any dependencies that are required for this change.

Fixes #(issue_no)

Type of change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [x] This change requires a documentation update
  • [ ] Documentation update

Checklist:

  • [x] I have performed a self-review of my own code.
  • [x] I have commented my code, particularly in hard-to-understand areas.
  • [x] I have made corresponding changes to the documentation.
  • [ ] My changes generate no new warnings.
  • [x] I have added tests/screenshots (if any) that prove my fix is effective or that my feature works.
  • [x] I have tested the tests implicated (if any) by my own code and they pass (make test or ctest -VV -R <test-name>).
  • [ ] If my change is significant or breaking, I have passed all tests with ./docker-compose.sh test &> output and attached the output.
  • [ ] I have tested my code with OPTION_BUILD_ADDRESS_SANITIZER or ./docker-compose.sh test-address-sanitizer &> output and OPTION_TEST_MEMORYCHECK.
  • [ ] I have tested my code with OPTION_BUILD_THREAD_SANITIZER or ./docker-compose.sh test-thread-sanitizer &> output.
  • [ ] I have tested with Helgrind in case my code works with threading.
  • [ ] I have run make clang-format in order to format my code and my code follows the style guidelines.

If you are unclear about any of the above checks, have a look at our documentation here.

hulxv avatar Sep 27 '24 21:09 hulxv

@devraymondsh @viferga

hulxv avatar Sep 29 '24 18:09 hulxv

The X_untyped function format is designed so that the user is not forced to pass a generic and would use the value through pointer polymorphism. Adding a generic to it would not only be a noticeable breaking change but I wouldn't think it's a good idea anyway. I suggest making a new API specifically for async functions which would be something like X_async or something similar.

devraymondsh avatar Sep 30 '24 10:09 devraymondsh

I solved this with the last commits, you can check now the implementation. We should review the memory leaks now. And also maybe improve the frontend API and add HList pattern with macros for doing the call: https://github.com/metacall/core/pull/538

viferga avatar Dec 17 '24 22:12 viferga