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

CFE_ES_GetPoolBuf() return value is confusing #2136

Open
CDKnightNASA opened this issue Aug 11, 2022 · 1 comment
Open

CFE_ES_GetPoolBuf() return value is confusing #2136

CDKnightNASA opened this issue Aug 11, 2022 · 1 comment

Comments

@CDKnightNASA
Copy link
Contributor

On error, CFE_ES_GetPoolBuf() returns a status code, but on success, it returns the size allocated (which is actually the Size input parameter, so the return value is redundant.) I suggest either make the Size parameter an in/out parameter, or just return a CFE status and the caller can assume CFE_SUCCESS means the memory size requested was allocated.

int32 CFE_ES_GetPoolBuf(CFE_ES_MemPoolBuf_t *BufPtr, CFE_ES_MemHandle_t Handle, size_t Size)

@skliper
Copy link
Contributor

skliper commented Aug 11, 2022

Agreed, although in theory API change requires a "major update" unless we can do it by just adding an API and deprecating this one. If we do it here we might want to tackle the rest of the "multiple success return codes" issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants