# Allow swallow in checkAllAllocationFailures?

**URL:** <https://ziggit.dev/t/allow-swallow-in-checkallallocationfailures/18187>\
**Category:** Brainstorming\
**Tags:** standard-library, testing\
**Created:** [November 2, 2026, 5:45pm UTC](https://ziggit.dev/t/allow-swallow-in-checkallallocationfailures/18187 "2026-11-02T17:45:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dennypenta](https://ziggit.dev/user_avatar/ziggit.dev/dennypenta/32/8587_2.png) [@dennypenta](https://ziggit.dev/u/dennypenta)\
**Post date:** [November 2, 2026, 5:45pm UTC](https://ziggit.dev/t/allow-swallow-in-checkallallocationfailures/18187/1 "2026-11-02T17:45:50Z")

</div>

There is a very useful thing `checkAllAllocationFailures`.

but it has a limitation:  
If my code ignores OOM and doesn’t proxy it up, it gives an error that OOM is swallowed.

Apparently it is very easy to face such a case: `_ = arena.reset`.

So I did a custom checkAllAllocationFailures that allows swallowing specifically for one function testing.  
It feels bad and rather smell/low quality fix.

how would you handle it?

---

<div class="post-metadata">

**Author:** ![xydone](https://ziggit.dev/letter_avatar_proxy/v4/letter/x/96bed5/32.png) [@xydone](https://ziggit.dev/u/xydone)\
**Post date:** [November 2, 2026, 5:49pm UTC](https://ziggit.dev/t/allow-swallow-in-checkallallocationfailures/18187/2 "2026-11-02T17:49:02Z")

</div>

You would ideally surface OOM all the way to the place where you handle OOMs. If you have code that tries to free memory, after which it retries before giving up, that would be where you would surface it. For most Zig code (that I have written and seen written), this would be the main entry point, and handling it constitutes exiting with an error 😆
