Skip to content

Add idempotent behavior to loader handle loading#649

Draft
SATVIKsynopsis wants to merge 2 commits intometacall:developfrom
SATVIKsynopsis:idempotent_load_handle
Draft

Add idempotent behavior to loader handle loading#649
SATVIKsynopsis wants to merge 2 commits intometacall:developfrom
SATVIKsynopsis:idempotent_load_handle

Conversation

@SATVIKsynopsis
Copy link
Copy Markdown
Contributor

@SATVIKsynopsis SATVIKsynopsis commented Mar 1, 2026

Description

Implemented idempotent load behavior in loader_impl.c for load_from_file, load_from_memory, load_from_package, and loader_impl_handle_initialize. When a handle is already loaded, returns success instead of erroring, and assign the existing handle to *handle_ptr if provided.

Fixes #644

Type of change

  • 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)
  • This change requires a documentation update
  • Documentation update

Checklist:

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests/screenshots (if any) that prove my fix is effective or that my feature works.
  • 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.

@viferga viferga marked this pull request as draft March 2, 2026 18:40
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.

MetaCall level cache to avoid recompiling identical loader inputs

1 participant