Skip to content
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

Update CONTRIBUTING.md #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

## C++ Rules

- No exceptions (like, *never*), use `Result<T, E>`
- No `new`, `delete`, `malloc`, or `free`, use the container types (i.e. `Vec`, `PinVec`, `List`), handle types (`Rc`, `Unique`), or the provided allocator API
- No RTTI (`dynamic_cast`, `typeid`, `typeinfo`)
- No multiple inheritance of types sharing common base classes
- No constructors with side-effects, constructors must only copy bytes
- Constructors requiring complex operations to construct members must be split into separate helper functions
- Avoid implicit conversions where possible
- Functions using/allocating memory must take an allocator argument
- Use the provided standard library facilities
- When writing or wrapping one-time C code use the `defer` facility to manage resources, instead of manually cleaning up resources on each path
- Use templates sparingly, only when there's no other way to solve the problem
- Order structs and classes based on their access patterns and cache associativity
Loading