RTEMS | Improve event record handling (!282)

Sebastian Huber (@sebhub) gitlab at rtems.org
Sun Nov 3 11:21:28 UTC 2024




Sebastian Huber commented on a discussion on cpukit/include/rtems/record.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/282#note_114244

 > + *
 > + * The structure shall be initialized by rtems_record_fetch_initialize().
 > + */
 > +typedef struct {
 > +#ifdef RTEMS_SMP
 > +  /**
 > +   * @brief This member contains the index of the processor from which the next
 > +   *   records are fetched.
 > +   */
 > +  uint32_t cpu_index;
 > +#endif
 > +  /**
 > +   * @brief This member contains the count of records which need to be fetched
 > +   *   from the current processor before the next processor is selected.
 > +   */
 > +  size_t cpu_todo;

The `size_t` should be not only used for things which are in bytes. It should be used for things which are somehow related to object sizes. For example, in `calloc()` the number of elements is also a `size_t` parameter. On a 64-bit system, you could have more than 4G items in principle.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/282#note_114244
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20241103/7b90b105/attachment.htm>


More information about the bugs mailing list