Skip to content

Commit

Permalink
Remove lifetimes from principles
Browse files Browse the repository at this point in the history
Lifetime checking is out of scope for this library at this time.

Heap lifetime visibility can be achieved through PartitionAlloc, and an application may choose to use smart pointers that trap on lifetime errors, in tests or in production.

If we include smart pointers here, we should hook into PartitionAlloc or otherwise watch lifetimes, but even that only helps with individually-allocated heap objects. Stack and array objects don't get observed.

There's room for on-stack smart pointers, or static analysis such as a borrow checker to improve things here. If such tools become available, we will integrate any needed support into Subspace and eliminate or extend C++ differences from Rust APIs where needed to support them.
  • Loading branch information
danakj authored Aug 9, 2023
1 parent e6982d6 commit 5fbdebb
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion PRINCIPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ This library is an experiment and not intended for use. See the
be packed into the tail padding, if it exists and is usable by the compiler
implementation.
1. Bounds are always checked unless you explicitly ask for them to not be.
1. Lifetimes are always checked unless you explicitly ask for them to not be.
1. Small headers. C++ compilation speed is proportional to the amount of input.
* We will split types into separate headers as much as possible.
* We may provide headers which group together smaller headers for simplicity
Expand Down

0 comments on commit 5fbdebb

Please sign in to comment.