You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The ES memory pool API uses uint32* as a buffer pointer - this is the type used in CFE_ES_GetPoolBuf() and CFE_ES_PutPoolBuf() among others.
This presents a few usability problems:
Most often the data being stored is not actually uint32 - so it generally needs to be type cast by the user.
Typecasts are ugly and risky
Specifically - Typecasts to/from uint32* might create a warning about alignment on some platforms (one direction or the other is likely to be seen as an upgrade in alignment requirement)
If alignment was the goal, 32 bits is still too low for double type, or a 64-bit pointer, so it fails at that job.
Describe the solution you'd like
The API should use void*.
Additional context
Although this basically turns off type checking, there was no real type checking here to begin with, and pool buffers intentionally should be convertible to any type, so no need for it here anyway.
Using void* will clean up the code substantially, allowing a lot of unnecessary type casts to be removed.
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The ES memory pool API uses
uint32*
as a buffer pointer - this is the type used inCFE_ES_GetPoolBuf()
andCFE_ES_PutPoolBuf()
among others.This presents a few usability problems:
uint32
- so it generally needs to be type cast by the user.uint32*
might create a warning about alignment on some platforms (one direction or the other is likely to be seen as an upgrade in alignment requirement)double
type, or a 64-bit pointer, so it fails at that job.Describe the solution you'd like
The API should use
void*
.Additional context
Although this basically turns off type checking, there was no real type checking here to begin with, and pool buffers intentionally should be convertible to any type, so no need for it here anyway.
Using
void*
will clean up the code substantially, allowing a lot of unnecessary type casts to be removed.Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: