A fast, friendly, functional language. https://roc-lang.org
Find a file
Richard Feldman 9bb77328a6
Add tag_union handling to decrefLayoutPtr to fix memory leak
The increfLayoutPtr function properly handled .tag_union layouts by
reading the discriminant and incrementing the reference count of the
active variant's payload. However, decrefLayoutPtr was missing this
handling entirely, causing memory leaks when tag union values with
heap-allocated payloads were freed.

This fix adds symmetric .tag_union handling to decrefLayoutPtr that
reads the discriminant and decrefs the active variant's payload.

Fixes #8710

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 21:57:49 -05:00
.cargo
.devcontainer
.github retry on timeout 2025-12-16 18:28:44 +01:00
.reuse
ci Implement bitwise shifts (#8469) 2025-12-17 19:32:38 +01:00
crates don't ask to report issue for old compiler (#8683) 2025-12-15 17:01:43 +01:00
design
devtools
docker
examples
nix
src Add tag_union handling to decrefLayoutPtr to fix memory leak 2025-12-21 21:57:49 -05:00
test Fix TypeContainedMismatch when using type alias inside Try 2025-12-20 21:45:07 -05:00
.gitattributes
.gitignore
.llvmenv
.rules
AGENT.md
authors
build.zig Merge remote-tracking branch 'remote/cli-err-reporting' into implement-box-with-cli-err-reporting 2025-12-17 15:28:54 +11:00
build.zig.zon
BUILDING_FROM_SOURCE.md
Cargo.lock
Cargo.toml
code_of_conduct.md
CONTRIBUTING.md
default.nix
flake.lock
flake.nix
Glossary.md
legal_details
LICENSE
mlc_config.json
README.md
rust-toolchain.toml
shell.nix
typos.toml
version.txt

Work in progress!

Roc is not ready for a 0.1 release yet, but we do have:

If you'd like to contribute, get started here. Don't hesitate to ask for help on our group chat, we're friendly!

Sponsors

You can 💜 sponsor 💜 Roc on:

We are very grateful for our corporate sponsors Lambda Class, ohne-makler, and Decem:

Lambda Class logo      ohne-makler logo      Decem logo

If you would like your company to become a corporate sponsor of Roc's development, please DM Richard Feldman on Zulip!

We'd also like to express our gratitude to our generous individual sponsors! A special thanks to those sponsoring $25/month or more:

Thank you all so much for helping Roc progress!