# Use a closure to allocate structs onto the \`Arena\` · gitcafe/zed

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

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

Visibility: public

Requested revision: 5a4e2e6b90900fe685ce69ff230da5163f370a76

Requested commit: 5a4e2e6b90900fe685ce69ff230da5163f370a76

Commit: 5a4e2e6b90900fe685ce69ff230da5163f370a76

Tree: 4ec38aecaa766136aea0d90e6a104b4abc06d31b

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Use a closure to allocate structs onto the `Arena`

This is a trick borrowed from Bumpalo that helps LLVM understand
it should instantiate the object directly on the heap, as opposed to
doing so on the stack and then moving it.

```

## Parents

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

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