Skip to content

Remove unreachable OOM handling - #577

Open
azkrishpy wants to merge 2 commits into
todosfrom
todo/remove-oom-handling
Open

Remove unreachable OOM handling#577
azkrishpy wants to merge 2 commits into
todosfrom
todo/remove-oom-handling

Conversation

@azkrishpy

Copy link
Copy Markdown
Contributor

Issue #, if available: N/A

Description of changes:

The CRT allocators abort on failure rather than returning NULL — aws_mem_acquire,
aws_mem_calloc and aws_mem_acquire_many all route through AWS_PANIC_OOM, which is an
unconditional exit(-1). The OOM branches guarded by these checks were therefore unreachable.

Removes those checks and the error paths behind them, and folds a few acquire-then-zero pairs
into aws_mem_calloc. No assert is added in their place: it would be dead in debug and compiled
out in release, since the abort happens before control returns.

No behavior change. No new tests — the existing suite covers these paths and passes unchanged (745).

Part of the todos stack (#576). Base is todos, not main.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@azkrishpy
azkrishpy requested a review from a team as a code owner September 1, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants