-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…c "incomplete Simplicity type" type dada0f2 ci: fix recent breakage from `cc` (Andrew Poelstra) d7cfc34 types: introduce TypeInner, make Type the only public type (Andrew Poelstra) ded63fd types: replace Context::bind with Context::bind_product (Andrew Poelstra) e68151b types: use `Type` rather than `Bound` in the error enum (Andrew Poelstra) d63f87b types: refactor to pull some Bound constructors into Context (Andrew Poelstra) 7c47778 types: refactor to pull out some type destructuring logic from bind() (Andrew Poelstra) f3e5230 types: refactor to reuse some code across constructors (Andrew Poelstra) eb58756 types: refactor bind/unify error return a bit (Andrew Poelstra) Pull request description: Previously we had two types, `Type` and `Bound`, which were mutually recursive. `Type` was also exposed in the public API as a type representing an incomplete Simplicity type. `Bound` was exposed in the public API for a couple of reasons which this PR eliminates. However, because `Type` is both public and unusable without a live type inference context, this means that it needs to contain an `Arc<Context>`. But this means that if we have a self-referential type, this leaks to a somewhat-convoluted reference cycle in which a `Type` holds an `Arc<Context>` which owns a set of `Bound`s which contain the original `Type`. If you are skeptical of this, try running the test harness in valgrind before and after the last commit of this PR -- you will see that previously we were leaking memory in the `memory_leak` unit test but now we are not. This completes the "type inference overhaul" needed to eliminate the memory leak in infinitely-sized types. ACKs for top commit: uncomputable: ACK dada0f2 Tree-SHA512: 93038e20f63ba4aabb7491a7daf94fb55cd9d4742bdd3ba42bd0dd3f7ff5133b8666a066e1ce0657ec664e62aea8eaa4463177591ae1c85b14e117e9f318407e
- Loading branch information
Showing
5 changed files
with
230 additions
and
189 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.