# stage2: un-tangle memory management of Decl and Namespace · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/2d8d681b5ee34663aa87f0583f7b1a012b17d5b4)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 2d8d681b5ee34663aa87f0583f7b1a012b17d5b4

Requested commit: 2d8d681b5ee34663aa87f0583f7b1a012b17d5b4

Commit: 2d8d681b5ee34663aa87f0583f7b1a012b17d5b4

Tree: fefb28fbbdc9ab0c94c41a8609402077307ce024

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: un-tangle memory management of Decl and Namespace

Before there was this "top_decl" and "tmp_namespace" stack values that
were kludgy and buggy. Now Sema is slightly reworked so that files which
are structs are analyzed with their own Decl and Namespace already set
up.

After this commit there are no memory leaks for a successful build-obj.

```

## Parents

- [5d696b0706de2ac267cb774ef39e0d81131d5c38](https://git.cafe/gitcafe/zig/commit/5d696b0706de2ac267cb774ef39e0d81131d5c38?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/2d8d681b5ee34663aa87f0583f7b1a012b17d5b4?format=markdown)
