RAII-V3 - automated resource management#689
Open
renehiemstra wants to merge 30 commits intoterralang:masterfrom
Open
RAII-V3 - automated resource management#689renehiemstra wants to merge 30 commits intoterralang:masterfrom
renehiemstra wants to merge 30 commits intoterralang:masterfrom
Conversation
…ion and added to relevant cmake files for installation
…nted out to get access to the C-libs but the macos13 and macos14 images in the CI require it. We need to look into this.
…itialize aggregate variables after a move.
* remove offset_ptr from descriptions * add comment to raii docs about changing this pointer * readd tests/raii-offset_ptr.t with clearer content
…ndmanagedassignment'
…f overloads corresponding to 'to' and 'from'. 'overload(to)' should come first.
…nd __move respectively. Also disabled custom __move.
…alize types that have no implementation of __dtor. This is useful for types that require initialization but do not cary a resource.
Member
elliottslaughter
left a comment
There was a problem hiding this comment.
Initial review on the design document only. Will start to look at the code next.
Co-authored-by: Elliott Slaughter <elliottslaughter@gmail.com>
…cope rather then after the variable decleration.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've closed RAII-V2 and reopened it here to put forward the finalized design.
Traditionally, Terra has only supported manual, C-style resource management. While functional, this approach limits the full potential of Terra’s powerful metaprogramming capabilities. To address this limitation, the contribution introduces automated resource management based on RAII. This enables the implementation of smart containers and smart pointers, like std::string, std::vector and std::unique_ptr, std::shared_ptr in C++.
The design does not introduce any breaking changes. No new keywords are introduced. Heap resources are acquired and released using the regular C stdlib functions such malloc and free, leaving memory allocation in the hands of the programmer.
The documented design can be found here.