Skip to content

Add RM_TryAlloc#10541

Merged
oranagra merged 2 commits intoredis:unstablefrom
guybe7:trymalloc
Apr 10, 2022
Merged

Add RM_TryAlloc#10541
oranagra merged 2 commits intoredis:unstablefrom
guybe7:trymalloc

Conversation

@guybe7
Copy link
Copy Markdown
Collaborator

@guybe7 guybe7 commented Apr 6, 2022

Similarly to LCS, some modules would want to try to allocate memory, and fail gracefully if the allocation fails.

Comment thread src/module.c Outdated
@oranagra oranagra added state:major-decision Requires core team consensus approval-needed Waiting for core team approval to be merged labels Apr 6, 2022
@oranagra
Copy link
Copy Markdown
Member

oranagra commented Apr 6, 2022

@redis/core-team please approve the API

Co-authored-by: Oran Agra <[email protected]>
@oranagra oranagra added the release-notes indication that this issue needs to be mentioned in the release notes label Apr 7, 2022
Copy link
Copy Markdown
Contributor

@madolson madolson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tests?

@oranagra
Copy link
Copy Markdown
Member

oranagra commented Apr 8, 2022

It's just another wrapper, I don't think tests will have great value.
Can't harm though..

@oranagra oranagra merged commit eeb0f14 into redis:unstable Apr 10, 2022
@oranagra oranagra mentioned this pull request Apr 27, 2022
enjoy-binbin pushed a commit to enjoy-binbin/redis that referenced this pull request Jul 31, 2023
Similarly to LCS, some modules would want to try to allocate memory, and
fail gracefully if the allocation fails
oranagra pushed a commit that referenced this pull request Jan 29, 2024
Modules may want to handle allocation failures gracefully. Adding
RM_TryCalloc() and RM_TryRealloc() for it.
RM_TryAlloc() was added before:
#10541
roggervalf pushed a commit to roggervalf/redis that referenced this pull request Feb 11, 2024
Modules may want to handle allocation failures gracefully. Adding
RM_TryCalloc() and RM_TryRealloc() for it.
RM_TryAlloc() was added before:
redis#10541
funny-dog pushed a commit to funny-dog/redis that referenced this pull request Sep 17, 2025
Modules may want to handle allocation failures gracefully. Adding
RM_TryCalloc() and RM_TryRealloc() for it.
RM_TryAlloc() was added before:
redis#10541
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval-needed Waiting for core team approval to be merged release-notes indication that this issue needs to be mentioned in the release notes state:major-decision Requires core team consensus

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants