Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/DutchGhost/zorrow
Borrowchecker in Zig
https://github.com/DutchGhost/zorrow
Last synced: about 1 month ago
JSON representation
Borrowchecker in Zig
- Host: GitHub
- URL: https://github.com/DutchGhost/zorrow
- Owner: DutchGhost
- License: mit
- Created: 2020-06-08T19:08:57.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-04T18:36:15.000Z (almost 2 years ago)
- Last Synced: 2024-10-27T12:45:14.099Z (about 2 months ago)
- Language: Zig
- Size: 14.6 KB
- Stars: 106
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-zig - DutchGhost/zorrow
README
# Zorrow
This is a userlevel implementation of borrowchk in Zig.This system is *not* borrowchk, as it requires to pass in unique types for operations
like acquiring a borrow, and reading from it. This library does not check for uniqueness
of the types passed in, it's up to the programmer to do this correctly.
An example of what is ment by `unique type`:```Zig
var cell = RefCell(usize, opaque {}).init(10);var borrow = cell.borrow(opaque {});
defer borrow.release();var value = borrow.read(opaque {});
```
Here we see `opaque {}` three times. it is required to pass those in, as Zorrow
heavily relies on unique types passed into it's API.## Minimum supported `Zig`
`master`## Recent changes
* 0.2.1
* Change all occurrences of `var` as argument type to `anytype`.
* 0.2
* Allow the use of `.{}` where previously `struct {}` was required.
* 0.1
* Initial implementation## Contributors
* [suirad](https://github.com/suirad)
* [kprotty](https://github.com/kprotty)
* [Kassane](https://github.com/kassane)