# gpui: Dynamic element arena \(\#32079\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/e5c812fbcbad552e01597a87db82bb0db65781e9)

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

Visibility: public

Requested revision: e5c812fbcbad552e01597a87db82bb0db65781e9

Requested commit: e5c812fbcbad552e01597a87db82bb0db65781e9

Commit: e5c812fbcbad552e01597a87db82bb0db65781e9

Tree: 1ac4b98f9aa4ce1bfdfa45116a4bdaac5c9d8138

Author: Matin Aniss

Committer: GitHub

## Message

```
gpui: Dynamic element arena (#32079)

Implements a chunking strategy for the element arena that allows it to
grow dynamically based on allocations, it is initialised with a single
chunk of a total size of 1 mebibyte. On allocation of data with a size
greater than the remaining space of the current chunk a new chunk is
created.

This reduces the memory allocation from the static 32 mebibytes, this
especially helps GPUI applications that don't need such a large element
arena and even Zed in most cases. This also prevents the panic when
allocations ever exceed the element arena.

Release Notes:

- N/A

---------

Co-authored-by: Michael Sloan <michael@zed.dev>
```

## Parents

- [294147f4738bc3bbe678d83e67f9d194146e9bf4](https://git.cafe/gitcafe/zed/commit/294147f4738bc3bbe678d83e67f9d194146e9bf4?format=markdown)

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