Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdlib malloc should not block indefinitely. #223

Merged
merged 1 commit into from
May 16, 2024

Conversation

hlef
Copy link
Contributor

@hlef hlef commented May 16, 2024

Currently malloc blocks indefinitely when it cannot perform an allocation. This deviates from the usual behavior of malloc, which would return a NULL pointer and may set errno, but not block indefinitely, when an allocation cannot be performed.

Set the timeout to 0 to immediately return when an allocation cannot be satisfied.

Currently `malloc` blocks indefinitely when it cannot perform an
allocation. This deviates from the usual behavior of `malloc`, which
would return a NULL pointer and may set `errno`, but not block
indefinitely, when an allocation cannot be performed.

Set the timeout to 0 to immediately return when an allocation cannot be
satisfied.

Signed-off-by: Hugo Lefeuvre <hugo.lefeuvre@scisemi.com>
@hlef hlef force-pushed the hlefeuvre/malloc-timeout branch from b642713 to 8c1a6bd Compare May 16, 2024 09:30
@davidchisnall davidchisnall enabled auto-merge (rebase) May 16, 2024 09:35
@davidchisnall davidchisnall merged commit 3ff0dda into microsoft:main May 16, 2024
7 checks passed
@hlef hlef deleted the hlefeuvre/malloc-timeout branch June 13, 2024 08:44
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.

None yet

2 participants