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

Implicit Freezing and close() functions #50

Merged
merged 15 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 14 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
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ set (TRIESTE_ENABLE_TESTING OFF)
FetchContent_MakeAvailable_ExcludeFromAll(trieste)
set(CMAKE_CXX_STANDARD 20)

# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
# set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fsanitize=address")

add_library(
rt OBJECT
src/rt/rt.cc
Expand Down
24 changes: 21 additions & 3 deletions docs/builtin.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Causes the interpreter to enter *interactive mode*.

Aborts the interpreter process. It's intended to indicate that an execution branch is not reachable.

#### `pass()`

Does nothing it can be used to fill empty blocks

## Constructors

#### `Region()`
Expand All @@ -22,7 +26,7 @@ Creates a new `cown` object.

The region must have a local reference count of one. The `move` keyword is used to replace the local value with `None`.

### `create(proto)`
#### `create(proto)`

Creates a new object from the given prototype.

Expand All @@ -34,9 +38,23 @@ Performs a deep freeze of the object and all referenced objects.

This will move the objects out of their current region into the immutable region. Cowns will stop the freeze propagation, as they can be safely shared across threads and behaviors.

#### `freeze_proto(obj)`
#### `close(reg)`

Forces the given region to close by invalidating all local references into to region and its subregions.

This function will also correct all dirty LRCs.

#### `try_close(reg)`

Checks if the given region can be closed. If the LRC is dirty or subreagions are open, it will correct all dirty LRCs.

Returns `True`, if the region is closed in the end, `False` otherwise.

## Pragmas

#### `pragma_disable_implicit_freezing()`

Performs a deep freeze of the prototype of the object.
Disables implicit freezing for the rest of the program.

## Mermaid

Expand Down
Loading