# stage1: memory/report overhaul · gitcafe/zig

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

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

Visibility: public

Requested revision: edb210905dcbe666fa5222bceacd2e5bdb16bb89

Requested commit: edb210905dcbe666fa5222bceacd2e5bdb16bb89

Commit: edb210905dcbe666fa5222bceacd2e5bdb16bb89

Tree: 984aec0e5bad756daf426855c54bae3c42c73eca

Author: Michael Dusan

Committer: Michael Dusan

## Message

```
stage1: memory/report overhaul

- split util_base.hpp from util.hpp
- new namespaces: `mem` and `heap`
- new `mem::Allocator` interface
- new `heap::CAllocator` impl with global `heap::c_allocator`
- new `heap::ArenaAllocator` impl
- new `mem::TypeInfo` extracts names without RTTI
- name extraction is enabled w/ ZIG_ENABLE_MEM_PROFILE=1
- new `mem::List` takes explicit `Allocator&` parameter
- new `mem::HashMap` takes explicit `Allocator&` parameter
- add Codegen.pass1_arena and use for all `ZigValue` allocs
- deinit Codegen.pass1_arena early in `zig_llvm_emit_output()`

```

## Parents

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

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