-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass non-primitive types to C as 'borrowed' where appropriate
Parameters passed to C functions are considered to be owned by the receiving function. As such, the receiving function must decrement the parameter's reference count to avoid memory leaks. An alternative is to pass parameters as borrowed by using the `@&` prefix in their type. The receiving function does not need to decrement the parameter's reference count but it must only be passed to other non-consuming functions.
- Loading branch information
1 parent
d7c8af4
commit ac80d81
Showing
1 changed file
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters