-
Notifications
You must be signed in to change notification settings - Fork 1
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
Allow to call bang func only to make return #38
Conversation
WalkthroughThe pull request introduces modifications to the Changes
Sequence DiagramsequenceDiagram
participant NIFFunc as NIFFunc
participant BangFunc as BangFunc
participant wrap_ret_call as wrap_ret_call
NIFFunc->>BangFunc: Invoke function
BangFunc->>wrap_ret_call: Call with environment and arguments
wrap_ret_call-->>BangFunc: Return tuple with return type and resource
BangFunc-->>NIFFunc: Return processed result
Possibly related PRs
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/kinda.zig (1)
294-304
: Consider caching repeated atoms and verifying error handling.The usage of
beam.make_atom(env, "kind")
and the newly introducedbeam.make_atom(env, RetKind.module_name)
in each call may introduce overhead if this function is called frequently. For performance, you might consider caching these atoms in a static variable or storing them at module initialization. Additionally, ensure that all failure modes (allocation, resource creation, etc.) are properly tested to confirm comprehensive error handling coverage.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/kinda.zig
(2 hunks)
🔇 Additional comments (2)
src/kinda.zig (2)
316-316
: Ensure consistent return handling for void functions.
This line delegates the return handling to wrap_ret_call
, which works well for non-void return types. However, if there's any plan to expand the 'void return' scenario in the future (e.g., partial returns or logs), ensure that the wrap_ret_call
usage remains consistent or is clearly gated by logic to handle these scenarios.
322-322
: Verify and update all call sites to the new compile-time attribute signature.
The signature change to comptime attrs: NIFFuncAttrs
can break upstream calls or macros that pass mutable data as attrs
. Review or test any existing calls to ensure they remain functional and update them if necessary.
Summary by CodeRabbit
New Features
wrap_ret_call
methodRefactor
NIFFunc
function